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

This commit is contained in:
Shauren authored and Ovahlord committed 2023-08-27 17:44:24 +02:00
1 parent 577bdd5ff4
commit 7acc26f09f
2 files changed
+12

No files matched your search

+4
View File
@@ -853,6 +853,10 @@ bool Unit::HasBreakableByDamageCrowdControlAura(Unit* excludeCasterChannel) cons
duel_hasEnded = true;
}
else if (victim->IsCreature() && damage >= health && victim->ToCreature()->HasStaticFlag(CREATURE_STATIC_FLAG_UNKILLABLE))
{
damage = health - 1;
}
else if (victim->IsVehicle() && damage >= (health-1) && victim->GetCharmer() && victim->GetCharmer()->GetTypeId() == TYPEID_PLAYER)
{
Player* victimRider = victim->GetCharmer()->ToPlayer();