feat(Core/Unit): New helpers for UnitFlag and UnitFlag2 (#11227)

This commit is contained in:
Kitzunu
2022-03-30 12:59:42 +02:00
committed by GitHub
parent 54c06eb72e
commit 856aed6fc6
243 changed files with 1205 additions and 1191 deletions

View File

@@ -2057,13 +2057,13 @@ void GameObject::CastSpell(Unit* target, uint32 spellId)
// needed for GO casts for proper target validation checks
trigger->SetOwnerGUID(owner->GetGUID());
// xinef: fixes some duel bugs with traps]
if (owner->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED))
trigger->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED);
if (owner->HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED))
trigger->SetUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED);
if (owner->IsFFAPvP())
trigger->SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP);
// xinef: Remove Immunity flags
trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC);
trigger->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC);
// xinef: set proper orientation, fixes cast against stealthed targets
if (target)
trigger->SetInFront(target);