fix(Core/Combat): Removed UNIT_FLAG_IMMUNE_TO_PC when entering comb… (#12288)

fix(Core/Combat): Removed `UNIT_FLAG_IMMUNE_TO_PC` when entering combat with player.

Fixes #12211
Fixes #12214
Fixes #12219
Fixes #12212
This commit is contained in:
UltraNix
2022-07-03 21:28:36 +02:00
committed by GitHub
parent d7d04c62b1
commit e6a6dceaee

View File

@@ -13163,7 +13163,7 @@ void Unit::SetInCombatState(bool PvP, Unit* enemy, uint32 duration)
// xinef: if we somehow engage in combat (scripts, dunno) with player, remove this flag so he can fight back
if (GetTypeId() == TYPEID_UNIT && enemy && IsImmuneToPC() && enemy->GetCharmerOrOwnerPlayerOrPlayerItself())
SetImmuneToPC(true); // unit has engaged in combat, remove immunity so players can fight back
SetImmuneToPC(false); // unit has engaged in combat, remove immunity so players can fight back
if (IsInCombat())
return;