summaryrefslogtreecommitdiff
path: root/src/npc.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-03-27 14:26:23 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-03-27 14:34:30 +0100
commit31c28bbd0349475079ed2111c32b3cd07400554e (patch)
treef3068b3760b1782321143e3a06fe55fca8ae48f1 /src/npc.cpp
parent057e55c47ef3194ad56a09128eaa959984f2fd4a (diff)
downloadmana-31c28bbd0349475079ed2111c32b3cd07400554e.tar.gz
mana-31c28bbd0349475079ed2111c32b3cd07400554e.tar.bz2
mana-31c28bbd0349475079ed2111c32b3cd07400554e.tar.xz
mana-31c28bbd0349475079ed2111c32b3cd07400554e.zip
Fixed position of dots on minimap
Also made mPx and mPy private and synchronize with mPos on setPosition(). The side effects of setting destination and clearing the path have been removed from setPosition(). Only the tmwserv PlayerHandler seemed to rely on that feature. Mantis-issue: 672
Diffstat (limited to 'src/npc.cpp')
-rw-r--r--src/npc.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/npc.cpp b/src/npc.cpp
index d0a1a523..133f11c6 100644
--- a/src/npc.cpp
+++ b/src/npc.cpp
@@ -95,7 +95,9 @@ void NPC::setName(const std::string &name)
const std::string displayName = name.substr(0, name.find('#', 0));
delete mName;
- mName = new Text(displayName, mPx + NAME_X_OFFSET, mPy + NAME_Y_OFFSET,
+ mName = new Text(displayName,
+ getPixelX() + NAME_X_OFFSET,
+ getPixelY() + NAME_Y_OFFSET,
gcn::Graphics::CENTER,
&guiPalette->getColor(Palette::NPC));
Being::setName(displayName + " (NPC)");
@@ -142,14 +144,8 @@ void NPC::updateCoords()
{
if (mName)
{
-#ifdef TMWSERV_SUPPORT
- const Vector &pos = getPosition();
- const int px = (int) pos.x + NAME_X_OFFSET;
- const int py = (int) pos.y + NAME_Y_OFFSET;
-#else
- const int px = mPx + NAME_X_OFFSET;
- const int py = mPy + NAME_Y_OFFSET;
-#endif
+ const int px = getPixelX() + NAME_X_OFFSET;
+ const int py = getPixelY() + NAME_Y_OFFSET;
mName->adviseXY(px, py);
}
}