Fix spawn loading and saving, thanks to @BrunoDCC
This commit is contained in:
parent
efbd9ab693
commit
aaad8ab8a0
|
@ -109,8 +109,8 @@ void Spawn::save(TiXmlElement* node)
|
||||||
const Position& placePos = pair.first;
|
const Position& placePos = pair.first;
|
||||||
assert(placePos.isValid());
|
assert(placePos.isValid());
|
||||||
|
|
||||||
creatureNode->SetAttribute("x", placePos.x);
|
creatureNode->SetAttribute("x", c.x - placePos.x);
|
||||||
creatureNode->SetAttribute("y", placePos.y);
|
creatureNode->SetAttribute("y", c.y - placePos.y);
|
||||||
creatureNode->SetAttribute("z", placePos.z);
|
creatureNode->SetAttribute("z", placePos.z);
|
||||||
|
|
||||||
node->LinkEndChild(creatureNode);
|
node->LinkEndChild(creatureNode);
|
||||||
|
|
|
@ -53,7 +53,7 @@ public:
|
||||||
int32 getRadius() { return m_attribs.get<int32>(SpawnAttrRadius); }
|
int32 getRadius() { return m_attribs.get<int32>(SpawnAttrRadius); }
|
||||||
|
|
||||||
void setCenterPos(const Position& pos) { m_attribs.set(SpawnAttrCenter, pos); }
|
void setCenterPos(const Position& pos) { m_attribs.set(SpawnAttrCenter, pos); }
|
||||||
Position getCenterPos() { return m_attribs.get<Position>(SpawnAttrPos); }
|
Position getCenterPos() { return m_attribs.get<Position>(SpawnAttrCenter); }
|
||||||
|
|
||||||
void addCreature(const Position& placePos, const CreatureTypePtr& cType);
|
void addCreature(const Position& placePos, const CreatureTypePtr& cType);
|
||||||
void removeCreature(const Position& pos);
|
void removeCreature(const Position& pos);
|
||||||
|
|
Loading…
Reference in New Issue