summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/being/localplayer.cpp3
-rw-r--r--src/being/localplayer.h7
-rw-r--r--src/gui/windows/charselectdialog.cpp5
-rw-r--r--src/net/eathena/charserverhandler.cpp2
4 files changed, 15 insertions, 2 deletions
diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp
index b747c78bd..e8cceadae 100644
--- a/src/being/localplayer.cpp
+++ b/src/being/localplayer.cpp
@@ -172,7 +172,8 @@ LocalPlayer::LocalPlayer(const int id, const uint16_t subtype) :
mKeepAttacking(false),
mPathSetByMouse(false),
mWaitPing(false),
- mShowNavigePath(false)
+ mShowNavigePath(false),
+ mAllowRename(false)
{
logger->log1("LocalPlayer::LocalPlayer");
diff --git a/src/being/localplayer.h b/src/being/localplayer.h
index ed2b42b53..bfec5ad58 100644
--- a/src/being/localplayer.h
+++ b/src/being/localplayer.h
@@ -403,6 +403,12 @@ class LocalPlayer final : public Being,
AwayListener *getAwayListener() const A_WARN_UNUSED
{ return mAwayListener; }
+ void setRename(const bool r)
+ { mAllowRename = r; }
+
+ bool getRename() const
+ { return mAllowRename; }
+
protected:
void updateCoords() override final;
@@ -510,6 +516,7 @@ class LocalPlayer final : public Being,
bool mPathSetByMouse;
bool mWaitPing;
bool mShowNavigePath;
+ bool mAllowRename;
};
extern LocalPlayer *localPlayer;
diff --git a/src/gui/windows/charselectdialog.cpp b/src/gui/windows/charselectdialog.cpp
index 32a3ea410..8d80fe1f7 100644
--- a/src/gui/windows/charselectdialog.cpp
+++ b/src/gui/windows/charselectdialog.cpp
@@ -593,6 +593,11 @@ void CharSelectDialog::updateState()
{
// TRANSLATORS: char select dialog. button.
mPlayButton->setCaption(_("Play"));
+
+ LocalPlayer *const player = mCharacterEntries[
+ idx]->getCharacter()->dummy;
+ if (player)
+ mRenameButton->setEnabled(player->getRename() ? true : false);
}
else
{
diff --git a/src/net/eathena/charserverhandler.cpp b/src/net/eathena/charserverhandler.cpp
index b0a7249f5..e595c9ed4 100644
--- a/src/net/eathena/charserverhandler.cpp
+++ b/src/net/eathena/charserverhandler.cpp
@@ -235,7 +235,7 @@ void CharServerHandler::readPlayerData(Net::MessageIn &msg,
msg.readInt32("delete date");
msg.readInt32("robe");
msg.readInt32("slot change");
- msg.readInt32("rename (inverse)");
+ tempPlayer->setRename(msg.readInt32("rename (inverse)"));
}
void CharServerHandler::chooseCharacter(Net::Character *const character)