Refactor creature proximity aggro related code.
- Units immune to NPCs can no longer attack NPCs. - Units immune to PCs can no longer attack PCs. - Civilians can call guards when attacked by creatures too. - If you go near a creature your party members are attacking, you will enter combat too.
This commit is contained in:
@@ -3500,7 +3500,7 @@ bool WorldObject::IsValidAttackTarget(Unit const* target, bool checkAlive) const
|
||||
if (FindMap() != target->FindMap())
|
||||
return false;
|
||||
|
||||
if (!target->IsTargetable(true, IsCharmerOrOwnerPlayerOrPlayerItself(), false, checkAlive))
|
||||
if (!target->IsTargetableBy(this, false, checkAlive))
|
||||
return false;
|
||||
|
||||
Unit const* pThisUnit = ToUnit();
|
||||
|
||||
Reference in New Issue
Block a user