summaryrefslogtreecommitdiff
path: root/src/player.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/player.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/player.cpp')
-rw-r--r--src/player.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/player.cpp b/src/player.cpp
index de4a012b..b966e891 100644
--- a/src/player.cpp
+++ b/src/player.cpp
@@ -58,14 +58,18 @@ void Player::setName(const std::string &name)
if (mIsGM)
{
mNameColor = &guiPalette->getColor(Palette::GM);
- mName = new FlashText("(GM) " + name, mPx + NAME_X_OFFSET, mPy +
- NAME_Y_OFFSET, gcn::Graphics::CENTER,
+ mName = new FlashText("(GM) " + name,
+ getPixelX() + NAME_X_OFFSET,
+ getPixelY() + NAME_Y_OFFSET,
+ gcn::Graphics::CENTER,
&guiPalette->getColor(Palette::GM_NAME));
}
else
{
mNameColor = &guiPalette->getColor(Palette::PLAYER);
- mName = new FlashText(name, mPx + NAME_X_OFFSET, mPy + NAME_Y_OFFSET,
+ mName = new FlashText(name,
+ getPixelX() + NAME_X_OFFSET,
+ getPixelY() + NAME_Y_OFFSET,
gcn::Graphics::CENTER,
(this == player_node) ?
&guiPalette->getColor(Palette::SELF) :
@@ -233,7 +237,8 @@ void Player::setSprite(int slot, int id, const std::string &color)
void Player::updateCoords()
{
if (mName)
- mName->adviseXY(mPx + NAME_X_OFFSET, mPy + NAME_Y_OFFSET);
+ mName->adviseXY(getPixelX() + NAME_X_OFFSET,
+ getPixelY() + NAME_Y_OFFSET);
}
#ifdef TMWSERV_SUPPORT