Attempt to fix spawn loader
This commit is contained in:
parent
092209c0bb
commit
efbd9ab693
|
@ -76,10 +76,12 @@ void Spawn::load(TiXmlElement* node)
|
||||||
dir = (Otc::Direction)dir_;
|
dir = (Otc::Direction)dir_;
|
||||||
cType->setDirection(dir);
|
cType->setDirection(dir);
|
||||||
|
|
||||||
centerPos.x += cNode->readType<int>("x");
|
Position placePos;
|
||||||
centerPos.y += cNode->readType<int>("y");
|
placePos.x = centerPos.x + cNode->readType<int>("x");
|
||||||
centerPos.z = cNode->readType<int>("z");
|
placePos.y = centerPos.y + cNode->readType<int>("y");
|
||||||
addCreature(centerPos, cType);
|
placePos.z = cNode->readType<int>("z");
|
||||||
|
|
||||||
|
addCreature(placePos, cType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -357,8 +359,11 @@ SpawnPtr CreatureManager::getSpawn(const Position& centerPos)
|
||||||
SpawnPtr CreatureManager::addSpawn(const Position& centerPos, int radius)
|
SpawnPtr CreatureManager::addSpawn(const Position& centerPos, int radius)
|
||||||
{
|
{
|
||||||
auto iter = m_spawns.find(centerPos);
|
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;
|
return iter->second;
|
||||||
|
}
|
||||||
|
|
||||||
SpawnPtr ret(new Spawn);
|
SpawnPtr ret(new Spawn);
|
||||||
|
|
||||||
|
@ -369,3 +374,5 @@ SpawnPtr CreatureManager::addSpawn(const Position& centerPos, int radius)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* vim: set ts=4 sw=4 et: */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue