fix(Core/Entities): Improve interactions between taxis and players regarding PvP flag. (#23681)

This commit is contained in:
Benjamin Jackson
2025-11-15 03:21:22 -05:00
committed by GitHub
parent 6b9a8df5dc
commit c552158e99
4 changed files with 10 additions and 15 deletions

View File

@@ -83,29 +83,19 @@ WorldObject* CreatureAI::GetSummoner() const
inline bool IsValidCombatTarget(Creature* source, Player* target)
{
if (target->IsGameMaster())
{
return false;
}
if (!source->IsInWorld() || !target->IsInWorld())
{
return false;
}
if (!source->IsAlive() || !target->IsAlive())
{
return false;
}
if (!source->InSamePhase(target))
{
return false;
}
if (source->HasUnitState(UNIT_STATE_IN_FLIGHT) || target->HasUnitState(UNIT_STATE_IN_FLIGHT))
{
if (source->IsInFlight() || target->IsInFlight())
return false;
}
return true;
}