From fd7edc85cee0714896c181d0ae17cca17a382b80 Mon Sep 17 00:00:00 2001 From: Chuck Miller Date: Fri, 8 May 2009 19:16:12 -0400 Subject: Fixed so player display names to show correctly when the being is created. Not just when the config value is changed. --- src/player.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/player.cpp') 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()); } -- cgit v1.2.3-60-g2f50