Merge branch 'azerothcore:master' into Playerbot

This commit is contained in:
ZhengPeiRu21
2022-03-30 09:53:52 -06:00
committed by GitHub
245 changed files with 1241 additions and 1200 deletions

View File

@@ -2058,13 +2058,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);