From d34c6e7b7048dbcead251c190fec5a7c584c0e3a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 23 Jan 2011 05:29:04 +0200 Subject: Fix possible negative job level with tmw server. --- src/gui/statuswindow.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/gui/statuswindow.cpp b/src/gui/statuswindow.cpp index ed29be119..c4d8339e1 100644 --- a/src/gui/statuswindow.cpp +++ b/src/gui/statuswindow.cpp @@ -331,8 +331,15 @@ void StatusWindow::event(Channels channel _UNUSED_, // then we fixing it :) std::pair exp = PlayerInfo::getStatExperience(id); - lvl = (exp.second - 20000) / 150; - PlayerInfo::setStatBase(id, lvl); + if (exp.second < 20000) + { + lvl = 0; + } + else + { + lvl = (exp.second - 20000) / 150; + PlayerInfo::setStatBase(id, lvl); + } } mJobLvlLabel->setCaption(strprintf(_("Job: %d"), lvl)); -- cgit v1.2.3-70-g09d2