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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user