Core/Spells: Fixed crash with some gameobject spell casters

This commit is contained in:
Shauren authored and Ovahlord committed 2022-09-12 09:15:22 +02:00
1 parent 54b65fc2ac
commit e395af341a
1 file changed
+2 -2
+2 -2
View File
@@ -3137,10 +3137,10 @@ bool WorldObject::IsValidAssistTarget(WorldObject const* target, SpellInfo const
// PvP case
if (unitTarget && unitTarget->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED))
{
Player const* targetPlayerOwner = target->GetAffectingPlayer();
if (unit && unit->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED))
{
Player const* selfPlayerOwner = GetAffectingPlayer();
Player const* targetPlayerOwner = unitTarget->GetAffectingPlayer();
if (selfPlayerOwner && targetPlayerOwner)
{
// can't assist player which is dueling someone
@@ -3148,7 +3148,7 @@ bool WorldObject::IsValidAssistTarget(WorldObject const* target, SpellInfo const
return false;
}
// can't assist player in ffa_pvp zone from outside
if (unitTarget->IsFFAPvP() && unit && !unit->IsFFAPvP())
if (unitTarget->IsFFAPvP() && !unit->IsFFAPvP())
return false;
// can't assist player out of sanctuary from sanctuary if has pvp enabled