summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/statuswindow.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/gui/statuswindow.cpp b/src/gui/statuswindow.cpp
index 853ea1789..ed29be119 100644
--- a/src/gui/statuswindow.cpp
+++ b/src/gui/statuswindow.cpp
@@ -324,8 +324,18 @@ void StatusWindow::event(Channels channel _UNUSED_,
{
if (mJobLvlLabel)
{
- mJobLvlLabel->setCaption(strprintf(_("Job: %d"),
- PlayerInfo::getStatBase(id)));
+ int lvl = PlayerInfo::getStatBase(id);
+ if (!lvl)
+ {
+ // possible server corrupted and dont send job level,
+ // then we fixing it :)
+ std::pair<int, int> exp
+ = PlayerInfo::getStatExperience(id);
+ lvl = (exp.second - 20000) / 150;
+ PlayerInfo::setStatBase(id, lvl);
+ }
+
+ mJobLvlLabel->setCaption(strprintf(_("Job: %d"), lvl));
mJobLvlLabel->adjustSize();
updateProgressBar(mJobBar, id, false);