summaryrefslogtreecommitdiff
path: root/src/gui/statuswindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-01-23 16:50:43 +0200
committerAndrei Karas <akaras@inbox.ru>2011-01-23 16:50:43 +0200
commit1d4ef0558e20984b572f35941e0b2f0650b5e399 (patch)
tree11f21754f43d27e6cca027451b67ff2fd18b3b2c /src/gui/statuswindow.cpp
parentd34c6e7b7048dbcead251c190fec5a7c584c0e3a (diff)
downloadplus-1d4ef0558e20984b572f35941e0b2f0650b5e399.tar.gz
plus-1d4ef0558e20984b572f35941e0b2f0650b5e399.tar.bz2
plus-1d4ef0558e20984b572f35941e0b2f0650b5e399.tar.xz
plus-1d4ef0558e20984b572f35941e0b2f0650b5e399.zip
Recover job experience limit from old job level.
Server send old limits in job levelup.
Diffstat (limited to 'src/gui/statuswindow.cpp')
-rw-r--r--src/gui/statuswindow.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/gui/statuswindow.cpp b/src/gui/statuswindow.cpp
index c4d8339e1..ba66e2587 100644
--- a/src/gui/statuswindow.cpp
+++ b/src/gui/statuswindow.cpp
@@ -325,12 +325,15 @@ void StatusWindow::event(Channels channel _UNUSED_,
if (mJobLvlLabel)
{
int lvl = PlayerInfo::getStatBase(id);
+
+ int oldExp = event.getInt("oldValue1");
+ std::pair<int, int> exp
+ = PlayerInfo::getStatExperience(id);
+
if (!lvl)
{
- // possible server corrupted and dont send job level,
+ // possible server broken and dont send job level,
// then we fixing it :)
- std::pair<int, int> exp
- = PlayerInfo::getStatExperience(id);
if (exp.second < 20000)
{
lvl = 0;
@@ -342,6 +345,14 @@ void StatusWindow::event(Channels channel _UNUSED_,
}
}
+ if (exp.first < oldExp && exp.second >= 20000)
+ { // possible job level up. but server broken and dont send
+ // new job exp limit, we fixing it
+ lvl ++;
+ PlayerInfo::setStatExperience(id, exp.first, 20000 + lvl * 150);
+ PlayerInfo::setStatBase(id, lvl);
+ }
+
mJobLvlLabel->setCaption(strprintf(_("Job: %d"), lvl));
mJobLvlLabel->adjustSize();