diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-10-15 18:14:19 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-10-18 16:21:43 +0300 |
commit | a499c34b05b70a72572d8e43572def558403338e (patch) | |
tree | 2322f00723e6ebe5a53e8bfc08851ac3babbd475 /src/being | |
parent | e05956bcbefba4f846f90e7f5c9c05c4931b3a26 (diff) | |
download | manaverse-a499c34b05b70a72572d8e43572def558403338e.tar.gz manaverse-a499c34b05b70a72572d8e43572def558403338e.tar.bz2 manaverse-a499c34b05b70a72572d8e43572def558403338e.tar.xz manaverse-a499c34b05b70a72572d8e43572def558403338e.zip |
Add packet SMSG_PLAYER_GET_EXP2 0x0acc.
Diffstat (limited to 'src/being')
-rw-r--r-- | src/being/localplayer.cpp | 29 | ||||
-rw-r--r-- | src/being/localplayer.h | 4 |
2 files changed, 21 insertions, 12 deletions
diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp index 1a12a3808..94fa39a1f 100644 --- a/src/being/localplayer.cpp +++ b/src/being/localplayer.cpp @@ -1154,10 +1154,11 @@ void LocalPlayer::optionChanged(const std::string &value) } } -void LocalPlayer::addJobMessage(const int change) +void LocalPlayer::addJobMessage(const int64_t change) { if (change != 0 && mMessages.size() < 20) { + const std::string xpStr = toString(CAST_U64(change)); if (!mMessages.empty()) { MessagePair pair = mMessages.back(); @@ -1167,30 +1168,38 @@ void LocalPlayer::addJobMessage(const int change) pair.first.size() - strlen(_("xp")) - 1) { mMessages.pop_back(); - // TRANSLATORS: this is job experience - pair.first.append(strprintf(", %d %s", change, _("job"))); + pair.first.append(strprintf(", %s %s", + xpStr.c_str(), + // TRANSLATORS: this is job experience + _("job"))); mMessages.push_back(pair); } else { - // TRANSLATORS: this is job experience - addMessageToQueue(strprintf("%d %s", change, _("job"))); + addMessageToQueue(strprintf("%s %s", + xpStr.c_str(), + // TRANSLATORS: this is job experience + _("job"))); } } else { - // TRANSLATORS: this is job experience - addMessageToQueue(strprintf("%d %s", change, _("job"))); + addMessageToQueue(strprintf("%s %s", + xpStr.c_str(), + // TRANSLATORS: this is job experience + _("job"))); } } } -void LocalPlayer::addXpMessage(const int change) +void LocalPlayer::addXpMessage(const int64_t change) { if (change != 0 && mMessages.size() < 20) { - // TRANSLATORS: get xp message - addMessageToQueue(strprintf("%d %s", change, _("xp"))); + addMessageToQueue(strprintf("%s %s", + toString(CAST_U64(change)).c_str(), + // TRANSLATORS: get xp message + _("xp"))); } } diff --git a/src/being/localplayer.h b/src/being/localplayer.h index 897e4dc00..e7c38f21c 100644 --- a/src/being/localplayer.h +++ b/src/being/localplayer.h @@ -372,11 +372,11 @@ class LocalPlayer final : public Being, void stopAdvert(); - void addXpMessage(const int change); + void addXpMessage(const int64_t change); void addHomunXpMessage(const int change); - void addJobMessage(const int change); + void addJobMessage(const int64_t change); void addHpMessage(const int change); |