mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 17:19:07 +00:00
feat(Core/Unit): New helpers for UnitFlag and UnitFlag2 (#11227)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user