summaryrefslogtreecommitdiff
path: root/src/gui/statuswindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-01-23 21:27:04 +0200
committerAndrei Karas <akaras@inbox.ru>2011-01-23 21:27:04 +0200
commit088bb9486bb87580889941341a6dbd2f60076b27 (patch)
tree612a44267b3051258c3efdd9714ea0dd4f9d8541 /src/gui/statuswindow.cpp
parentc349a278a96217e7c7b490f208ec40a39e893898 (diff)
downloadmv-088bb9486bb87580889941341a6dbd2f60076b27.tar.gz
mv-088bb9486bb87580889941341a6dbd2f60076b27.tar.bz2
mv-088bb9486bb87580889941341a6dbd2f60076b27.tar.xz
mv-088bb9486bb87580889941341a6dbd2f60076b27.zip
Add some protection in predicting job level.
Also dont show need word if current experience more than needed.
Diffstat (limited to 'src/gui/statuswindow.cpp')
-rw-r--r--src/gui/statuswindow.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gui/statuswindow.cpp b/src/gui/statuswindow.cpp
index ba66e2587..d2460f68e 100644
--- a/src/gui/statuswindow.cpp
+++ b/src/gui/statuswindow.cpp
@@ -258,6 +258,10 @@ StatusWindow::StatusWindow():
void StatusWindow::event(Channels channel _UNUSED_,
const Mana::Event &event)
{
+ static bool blocked = false;
+ if (blocked)
+ return;
+
if (event.getName() == EVENT_UPDATEATTRIBUTE)
{
switch(event.getInt("id"))
@@ -341,7 +345,9 @@ void StatusWindow::event(Channels channel _UNUSED_,
else
{
lvl = (exp.second - 20000) / 150;
+ blocked = true;
PlayerInfo::setStatBase(id, lvl);
+ blocked = false;
}
}
@@ -349,8 +355,10 @@ void StatusWindow::event(Channels channel _UNUSED_,
{ // possible job level up. but server broken and dont send
// new job exp limit, we fixing it
lvl ++;
+ blocked = true;
PlayerInfo::setStatExperience(id, exp.first, 20000 + lvl * 150);
- PlayerInfo::setStatBase(id, lvl);
+ blocked = false;
+// PlayerInfo::setStatBase(id, lvl);
}
mJobLvlLabel->setCaption(strprintf(_("Job: %d"), lvl));