Core/Creatures: Implemented unkillable flag (prevent health from going below 1)

This commit is contained in:
Shauren
2023-03-11 00:07:57 +01:00
parent 379b1ec6ae
commit 7ea438ebdc
2 changed files with 12 additions and 0 deletions
+4
View File
@@ -857,6 +857,10 @@ bool Unit::HasBreakableByDamageCrowdControlAura(Unit* excludeCasterChannel) cons
duel_hasEnded = true;
}
else if (victim->IsCreature() && damageTaken >= health && victim->ToCreature()->HasFlag(CREATURE_STATIC_FLAG_UNKILLABLE))
{
damageTaken = health - 1;
}
else if (victim->IsVehicle() && damageTaken >= (health-1) && victim->GetCharmer() && victim->GetCharmer()->GetTypeId() == TYPEID_PLAYER)
{
Player* victimRider = victim->GetCharmer()->ToPlayer();