diff --git a/src/client/creatures.cpp b/src/client/creatures.cpp index 5f8e9037..24beafc4 100644 --- a/src/client/creatures.cpp +++ b/src/client/creatures.cpp @@ -76,10 +76,12 @@ void Spawn::load(TiXmlElement* node) dir = (Otc::Direction)dir_; cType->setDirection(dir); - centerPos.x += cNode->readType("x"); - centerPos.y += cNode->readType("y"); - centerPos.z = cNode->readType("z"); - addCreature(centerPos, cType); + Position placePos; + placePos.x = centerPos.x + cNode->readType("x"); + placePos.y = centerPos.y + cNode->readType("y"); + placePos.z = cNode->readType("z"); + + addCreature(placePos, cType); } } @@ -357,8 +359,11 @@ SpawnPtr CreatureManager::getSpawn(const Position& centerPos) SpawnPtr CreatureManager::addSpawn(const Position& centerPos, int radius) { auto iter = m_spawns.find(centerPos); - if(iter != m_spawns.end()) + if(iter != m_spawns.end()) { + if(iter->second->getRadius() != radius) + iter->second->setRadius(radius); return iter->second; + } SpawnPtr ret(new Spawn); @@ -369,3 +374,5 @@ SpawnPtr CreatureManager::addSpawn(const Position& centerPos, int radius) return ret; } +/* vim: set ts=4 sw=4 et: */ +