From 4fb756ef90981a90ae31446c1c094bf88e24d045 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 27 Mar 2014 12:38:32 +0300 Subject: Add option to show/hide server side position. By default server side position is hidden, before it was always visible. --- src/being/localplayer.cpp | 11 ++++++++--- src/being/localplayer.h | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'src/being') diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp index 55e7baca9..2e09f1690 100644 --- a/src/being/localplayer.cpp +++ b/src/being/localplayer.cpp @@ -161,6 +161,7 @@ LocalPlayer::LocalPlayer(const int id, const int subtype) : mAttackMoving(config.getBoolValue("attackMoving")), mAttackNext(config.getBoolValue("attackNext")), mShowJobExp(config.getBoolValue("showJobExp")), + mShowServerPos(config.getBoolValue("showserverpos")), mNextStep(false), mDisableCrazyMove(false), mGoingToTarget(false), @@ -202,6 +203,7 @@ LocalPlayer::LocalPlayer(const int id, const int subtype) : config.addListener("enableAdvert", this); config.addListener("tradebot", this); config.addListener("targetOnlyReachable", this); + config.addListener("showserverpos", this); setShowName(config.getBoolValue("showownname")); } @@ -1019,6 +1021,8 @@ void LocalPlayer::optionChanged(const std::string &value) mTradebot = config.getBoolValue("tradebot"); else if (value == "targetOnlyReachable") mTargetOnlyReachable = config.getBoolValue("targetOnlyReachable"); + else if (value == "showserverpos") + mShowServerPos = config.getBoolValue("showserverpos"); } void LocalPlayer::processEvent(const Channels channel, @@ -3552,14 +3556,15 @@ void LocalPlayer::setRealPos(const int x, const int y) { fixPos(1); - if ((mCrossX || mCrossY) && layer->getTile(mCrossX, mCrossY) + if ((mCrossX || mCrossY) + && layer->getTile(mCrossX, mCrossY) && layer->getTile(mCrossX, mCrossY)->getType() == MapItem::CROSS) { layer->setTile(mCrossX, mCrossY, MapItem::EMPTY); } - if (!layer->getTile(x, y) - || layer->getTile(x, y)->getType() == MapItem::EMPTY) + if (mShowServerPos && (!layer->getTile(x, y) + || layer->getTile(x, y)->getType() == MapItem::EMPTY)) { if (getTileX() != x && getTileY() != y) layer->setTile(x, y, MapItem::CROSS); diff --git a/src/being/localplayer.h b/src/being/localplayer.h index 5664b03b6..e3a235b06 100644 --- a/src/being/localplayer.h +++ b/src/being/localplayer.h @@ -651,6 +651,7 @@ class LocalPlayer final : public Being, bool mAwayMode; bool mPseudoAwayMode; bool mShowNavigePath; + bool mShowServerPos; }; extern LocalPlayer *player_node; -- cgit v1.2.3-70-g09d2