From aaad8ab8a08033b2d5ae9bcde68598a9f70d3268 Mon Sep 17 00:00:00 2001 From: Allan Ference Date: Tue, 20 Aug 2013 12:14:52 +0200 Subject: [PATCH] Fix spawn loading and saving, thanks to @BrunoDCC --- src/client/creatures.cpp | 4 ++-- src/client/creatures.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/creatures.cpp b/src/client/creatures.cpp index 24beafc4..d9f9b157 100644 --- a/src/client/creatures.cpp +++ b/src/client/creatures.cpp @@ -109,8 +109,8 @@ void Spawn::save(TiXmlElement* node) const Position& placePos = pair.first; assert(placePos.isValid()); - creatureNode->SetAttribute("x", placePos.x); - creatureNode->SetAttribute("y", placePos.y); + creatureNode->SetAttribute("x", c.x - placePos.x); + creatureNode->SetAttribute("y", c.y - placePos.y); creatureNode->SetAttribute("z", placePos.z); node->LinkEndChild(creatureNode); diff --git a/src/client/creatures.h b/src/client/creatures.h index 9b2d7bd4..ab019bbc 100644 --- a/src/client/creatures.h +++ b/src/client/creatures.h @@ -53,7 +53,7 @@ public: int32 getRadius() { return m_attribs.get(SpawnAttrRadius); } void setCenterPos(const Position& pos) { m_attribs.set(SpawnAttrCenter, pos); } - Position getCenterPos() { return m_attribs.get(SpawnAttrPos); } + Position getCenterPos() { return m_attribs.get(SpawnAttrCenter); } void addCreature(const Position& placePos, const CreatureTypePtr& cType); void removeCreature(const Position& pos);