1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Do not activate Life Drain if unit is fully healed

This commit is contained in:
Ivan Savenko
2025-11-02 12:50:27 +02:00
parent 155086d802
commit bdafb47655

View File

@@ -1448,7 +1448,7 @@ void BattleActionProcessor::applyBattleEffects(const CBattleInfoCallback & battl
}
//life drain handling
if(attackerState->hasBonusOfType(BonusType::LIFE_DRAIN) && def->isLiving())
if(attackerState->hasBonusOfType(BonusType::LIFE_DRAIN) && def->isLiving() && attackerState->getTotalHealth() != attackerState->getAvailableHealth())
{
int64_t toHeal = bsa.damageAmount * attackerState->valOfBonuses(BonusType::LIFE_DRAIN) / 100;
healInfo += attackerState->heal(toHeal, EHealLevel::RESURRECT, EHealPower::PERMANENT);