1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Fixed CID 1288882

This commit is contained in:
DjWarmonger 2016-11-25 19:54:28 +01:00
parent 2ac72bf75b
commit a86edca7d8

View File

@ -219,7 +219,7 @@ ui64 FuzzyHelper::estimateBankDanger (const CBank * bank)
totalStrength += config.second.totalStrength * config.first;
totalChance += config.first;
}
return totalStrength / totalChance;
return totalStrength / std::max<ui8>(totalChance, 1); //avoid division by zero
}