summaryrefslogtreecommitdiff
path: root/src/being
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-03-27 12:38:32 +0300
committerAndrei Karas <akaras@inbox.ru>2014-03-27 12:38:32 +0300
commit4fb756ef90981a90ae31446c1c094bf88e24d045 (patch)
tree31cb8a3d46987207c8948987a66e9361f7f0f648 /src/being
parent8626395ecd1bb47f2e67e576ec648c2ab34cb148 (diff)
downloadplus-4fb756ef90981a90ae31446c1c094bf88e24d045.tar.gz
plus-4fb756ef90981a90ae31446c1c094bf88e24d045.tar.bz2
plus-4fb756ef90981a90ae31446c1c094bf88e24d045.tar.xz
plus-4fb756ef90981a90ae31446c1c094bf88e24d045.zip
Add option to show/hide server side position.
By default server side position is hidden, before it was always visible.
Diffstat (limited to 'src/being')
-rw-r--r--src/being/localplayer.cpp11
-rw-r--r--src/being/localplayer.h1
2 files changed, 9 insertions, 3 deletions
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;