Core/Unit: Prevent AoE damage to have effect in some cases when faction is unfriendly but they don't attack you and you don't have at war enabled (Example, Sporaggar faction)

Fixes #15374
This commit is contained in:
StormBytePP committed 2015-08-29 02:35:58 +02:00
1 parent e27588fdba
commit 4ada913d02
1 file changed
+2 -2
+2 -2
View File
@@ -11947,9 +11947,9 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, Wo
|| target->GetReactionTo(this) > REP_NEUTRAL)
return false;
// Not all neutral creatures can be attacked
// Not all neutral creatures can be attacked (even some unfriendly faction does not react aggresive to you, like Sporaggar)
if (GetReactionTo(target) == REP_NEUTRAL &&
target->GetReactionTo(this) == REP_NEUTRAL)
target->GetReactionTo(this) <= REP_NEUTRAL)
{
if (!(target->GetTypeId() == TYPEID_PLAYER && GetTypeId() == TYPEID_PLAYER) &&
!(target->GetTypeId() == TYPEID_UNIT && GetTypeId() == TYPEID_UNIT))