summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-10 15:10:51 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-10 15:10:51 +0300
commited908d9f4f15fadceeb9c1babab95f00b615004b (patch)
treef4249a6d051ead6bb5e8cada5945a6dd3861c505 /src
parent279ebfc0831051375d8b7cc2b8bf4f60a19397c9 (diff)
downloadplus-ed908d9f4f15fadceeb9c1babab95f00b615004b.tar.gz
plus-ed908d9f4f15fadceeb9c1babab95f00b615004b.tar.bz2
plus-ed908d9f4f15fadceeb9c1babab95f00b615004b.tar.xz
plus-ed908d9f4f15fadceeb9c1babab95f00b615004b.zip
Improve server side position drawing.
Diffstat (limited to 'src')
-rw-r--r--src/being/localplayer.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp
index 4ef9b7f9d..70600ff2c 100644
--- a/src/being/localplayer.cpp
+++ b/src/being/localplayer.cpp
@@ -3062,11 +3062,15 @@ void LocalPlayer::setRealPos(const int x, const int y)
layer->setTile(mCrossX, mCrossY, MapItemType::EMPTY);
}
- if (mShowServerPos && (!layer->getTile(x, y)
- || layer->getTile(x, y)->getType() == MapItemType::EMPTY))
+ if (mShowServerPos)
{
- if (getTileX() != x && getTileY() != y)
- layer->setTile(x, y, MapItemType::CROSS);
+ const MapItem *const mapItem = layer->getTile(x, y);
+
+ if (!mapItem || mapItem->getType() == MapItemType::EMPTY)
+ {
+ if (getTileX() != x && getTileY() != y)
+ layer->setTile(x, y, MapItemType::CROSS);
+ }
}
mCrossX = x;