diff --git a/client/CHeroWindow.cpp b/client/CHeroWindow.cpp index e426818c4..2ae897432 100644 --- a/client/CHeroWindow.cpp +++ b/client/CHeroWindow.cpp @@ -231,9 +231,11 @@ void CHeroWindow::setHero(const CGHeroInstance *hero) secSkillAreas[g]->hoverText = std::string(bufor); } - //printing experience - sprintf(bufor, CGI->generaltexth->allTexts[2].c_str(), hero->level, CGI->heroh->reqExp(hero->level+1), hero->exp); - expArea->text = std::string(bufor); + //printing experience - original foramt does not support ui64 + expArea->text = CGI->generaltexth->allTexts[2].c_str(); + boost::replace_first(expArea->text, "%d", boost::lexical_cast(hero->level)); + boost::replace_first(expArea->text, "%d", boost::lexical_cast(CGI->heroh->reqExp(hero->level+1))); + boost::replace_first(expArea->text, "%d", boost::lexical_cast(hero->exp)); //printing spell points sprintf(bufor, CGI->generaltexth->allTexts[205].c_str(), hero->name.c_str(), hero->mana, hero->manaLimit()); diff --git a/hch/CObjectHandler.h b/hch/CObjectHandler.h index 0a44bde1d..36038c6fd 100644 --- a/hch/CObjectHandler.h +++ b/hch/CObjectHandler.h @@ -218,7 +218,7 @@ public: ////////////////////////////////////////////////////////////////////////// CHero * type; - ui64 exp; //experience point + ui64 exp; //experience points si32 level; //current level of hero std::string name; //may be custom std::string biography; //if custom