1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

fixed wrong battle result

This commit is contained in:
AlexVinS
2017-07-14 23:43:03 +03:00
parent 2fb531b6d0
commit df13851176
3 changed files with 21 additions and 5 deletions

View File

@ -264,12 +264,15 @@ void CHealth::toInfo(CHealthInfo & info) const
void CHealth::takeResurrected()
{
int64_t totalHealth = total();
if(resurrected != 0)
{
int64_t totalHealth = available();
totalHealth -= resurrected * owner->unitMaxHealth();
vstd::amax(totalHealth, 0);
setFromTotal(totalHealth);
resurrected = 0;
totalHealth -= resurrected * owner->unitMaxHealth();
vstd::amax(totalHealth, 0);
setFromTotal(totalHealth);
resurrected = 0;
}
}
///CStack