1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-03 00:46:55 +02:00
Extended range (ui64) for army strenght.
This commit is contained in:
DjWarmonger
2011-06-21 09:31:08 +00:00
parent 7c9c939675
commit 423fd2ffb7
6 changed files with 10 additions and 9 deletions

View File

@ -1253,10 +1253,10 @@ double CGHeroInstance::getHeroStrength() const
return sqrt((1.0 + 0.05*getPrimSkillLevel(0)) * (1.0 + 0.05*getPrimSkillLevel(1)));
}
int CGHeroInstance::getTotalStrength() const
ui64 CGHeroInstance::getTotalStrength() const
{
double ret = getHeroStrength() * getArmyStrength();
return (int) ret;
return (ui64) ret;
}
expType CGHeroInstance::calculateXp(expType exp) const
@ -2867,7 +2867,7 @@ const std::string & CGCreature::getHoverText() const
hoverName += "\n\n ";
hoverName += (*texts)[0];
int choice;
float ratio = ((float)getArmyStrength() / selHero->getTotalStrength());
double ratio = ((double)getArmyStrength() / selHero->getTotalStrength());
if (ratio < 0.1) choice = 1;
else if (ratio < 0.25) choice = 2;
else if (ratio < 0.6) choice = 3;