1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Fixed calculation of retaliation damage

This commit is contained in:
Ivan Savenko
2024-05-10 19:40:14 +00:00
parent 119c9a8fb4
commit ac4204f660

View File

@@ -760,7 +760,7 @@ DamageEstimation CBattleInfoCallback::battleEstimateDamage(const BattleAttackInf
DamageEstimation ret = calculateDmgRange(bai);
if(retaliationDmg)
if(retaliationDmg && bai.defender->ableToRetaliate())
{
if(bai.shooting)
{
@@ -782,7 +782,7 @@ DamageEstimation CBattleInfoCallback::battleEstimateDamage(const BattleAttackInf
};
DamageEstimation retaliationMin = estimateRetaliation(ret.damage.min);
DamageEstimation retaliationMax = estimateRetaliation(ret.damage.min);
DamageEstimation retaliationMax = estimateRetaliation(ret.damage.max);
retaliationDmg->damage.min = std::min(retaliationMin.damage.min, retaliationMax.damage.min);
retaliationDmg->damage.max = std::max(retaliationMin.damage.max, retaliationMax.damage.max);