From 5b00d74e1acccba5d2a6b90086db57dfffc8de64 Mon Sep 17 00:00:00 2001 From: DjWarmonger Date: Mon, 4 Feb 2013 19:22:19 +0000 Subject: [PATCH] Fixed commanders starting with 2^32 experience. --- lib/CObjectHandler.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/CObjectHandler.cpp b/lib/CObjectHandler.cpp index 4a8452728..1edd57612 100644 --- a/lib/CObjectHandler.cpp +++ b/lib/CObjectHandler.cpp @@ -769,13 +769,6 @@ void CGHeroInstance::initHero() } assert(validTypes()); - if (VLC->modh->modules.COMMANDERS) - { - commander = new CCommanderInstance (VLC->townh->factions[type->heroClass->faction].commander); - commander->setArmyObj (castToArmyObj()); //TODO: separate function for setting commanders - commander->giveStackExp (exp); - } - if (exp == 0xffffffff) { initExp(); @@ -789,6 +782,13 @@ void CGHeroInstance::initHero() level = 1; } + if (VLC->modh->modules.COMMANDERS) + { + commander = new CCommanderInstance (VLC->townh->factions[type->heroClass->faction].commander); + commander->setArmyObj (castToArmyObj()); //TODO: separate function for setting commanders + commander->giveStackExp (exp); //after our exp is set + } + hoverName = VLC->generaltexth->allTexts[15]; boost::algorithm::replace_first(hoverName,"%s",name); boost::algorithm::replace_first(hoverName,"%s", type->heroClass->name);