diff options
-rw-r--r-- | src/player.cpp | 9 | ||||
-rw-r--r-- | src/player.h | 1 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/player.cpp b/src/player.cpp index c5f0d6cd..478cb18b 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -44,6 +44,7 @@ Player::Player(int id, int job, Map *map): mIsGM(false), mInParty(false) { + mShowName = config.getValue("visiblenames", 1); config.addListener("visiblenames", this); } @@ -55,7 +56,7 @@ Player::~Player() void Player::setName(const std::string &name) { - if (!mName) + if (!mName && mShowName) { if (mIsGM) { @@ -295,13 +296,13 @@ void Player::optionChanged(const std::string &value) { if (value == "visiblenames" && getType() == Being::PLAYER && player_node != this) { - bool value = config.getValue("visiblenames", 1); - if (!value && mName) + mShowName = config.getValue("visiblenames", 1); + if (!mShowName && mName) { delete mName; mName = NULL; } - else if (value && !mName && !(getName().empty())) + else if (mShowName && !mName && !(getName().empty())) { setName(getName()); } diff --git a/src/player.h b/src/player.h index 07701528..f30a610b 100644 --- a/src/player.h +++ b/src/player.h @@ -155,6 +155,7 @@ class Player : public Being std::map<int, Guild*> mGuilds; #endif + bool mShowName; FlashText *mName; bool mIsGM; |