summaryrefslogtreecommitdiff
path: root/src/actormanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/actormanager.cpp')
-rw-r--r--src/actormanager.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/actormanager.cpp b/src/actormanager.cpp
index 966653a99..dd88bc7bb 100644
--- a/src/actormanager.cpp
+++ b/src/actormanager.cpp
@@ -1722,16 +1722,19 @@ void ActorManager::updateEffects(const std::map<int, int> &addEffects,
}
}
-Being *ActorManager::cloneBeing(const Being *const srcBeing)
+Being *ActorManager::cloneBeing(const Being *const srcBeing,
+ const int dx, const int dy,
+ const int id)
{
- Being *const dstBeing = actorManager->createBeing(srcBeing->getId() + 1,
+ Being *const dstBeing = actorManager->createBeing(srcBeing->getId() + id,
ActorType::PLAYER,
srcBeing->getSubType());
if (!dstBeing)
return nullptr;
dstBeing->setGender(srcBeing->getGender());
dstBeing->setAction(srcBeing->getCurrentAction(), 0);
- dstBeing->setTileCoords(srcBeing->getTileX(), srcBeing->getTileY());
+ dstBeing->setTileCoords(srcBeing->getTileX() + dx,
+ srcBeing->getTileY() + dy);
dstBeing->setName(srcBeing->getName());
dstBeing->setDirection(srcBeing->getDirection());
const size_t sz = srcBeing->getSpritesCount();