summaryrefslogtreecommitdiff
path: root/src/actormanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-07-31 13:28:46 +0300
committerAndrei Karas <akaras@inbox.ru>2014-07-31 13:28:46 +0300
commit3d32a17af9cdfffda1e1612afeef976fbe218212 (patch)
treee3b974c0773e13f986b5194847f8e3395287583f /src/actormanager.cpp
parent6bedbd1724e575a152250eeda7988423d01680ba (diff)
downloadplus-3d32a17af9cdfffda1e1612afeef976fbe218212.tar.gz
plus-3d32a17af9cdfffda1e1612afeef976fbe218212.tar.bz2
plus-3d32a17af9cdfffda1e1612afeef976fbe218212.tar.xz
plus-3d32a17af9cdfffda1e1612afeef976fbe218212.zip
Add to debugSpawn mass spawn function.
Now debuSpawn accept parameter with side size of rectangle with spawned clones.
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();