diff options
author | Chuck Miller <shadowmil@gmail.com> | 2009-05-08 19:16:12 -0400 |
---|---|---|
committer | Chuck Miller <shadowmil@gmail.com> | 2009-05-08 19:16:12 -0400 |
commit | fd7edc85cee0714896c181d0ae17cca17a382b80 (patch) | |
tree | f7714de3e5c0b034a9b7f5c5c48a428a5f30c882 /src/player.cpp | |
parent | a2ab6d765a3f205f282126ee4716a7b688b0c915 (diff) | |
download | mana-fd7edc85cee0714896c181d0ae17cca17a382b80.tar.gz mana-fd7edc85cee0714896c181d0ae17cca17a382b80.tar.bz2 mana-fd7edc85cee0714896c181d0ae17cca17a382b80.tar.xz mana-fd7edc85cee0714896c181d0ae17cca17a382b80.zip |
Fixed so player display names to show correctly when the being is created. Not just when the config value is changed.
Diffstat (limited to 'src/player.cpp')
-rw-r--r-- | src/player.cpp | 9 |
1 files changed, 5 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()); } |