aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKandera <KanderaDev@gmail.com>2012-09-04 11:10:19 -0400
committerKandera <KanderaDev@gmail.com>2012-09-04 11:11:15 -0400
commita1e3758484230c2ee30e3404bd811c81d0f35422 (patch)
tree17cbce97f67b8e2ab39ac5d0dc174cf5cc93a265
parent6d57bf7a75c8f5e15f1fcb3ceffcc5e33b93c286 (diff)
Core/Reputation: fix forced reputation auras with neutral. closes #5790
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 5118b5810b6..33f8828997d 100755
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -12266,19 +12266,21 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, Wo
if (GetReactionTo(target) == REP_NEUTRAL &&
target->GetReactionTo(this) == REP_NEUTRAL)
{
- if (
- !(target->GetTypeId() == TYPEID_PLAYER && GetTypeId() == TYPEID_PLAYER) &&
- !(target->GetTypeId() == TYPEID_UNIT && GetTypeId() == TYPEID_UNIT)
- )
+ if (!(target->GetTypeId() == TYPEID_PLAYER && GetTypeId() == TYPEID_PLAYER) &&
+ !(target->GetTypeId() == TYPEID_UNIT && GetTypeId() == TYPEID_UNIT))
{
Player const* player = target->GetTypeId() == TYPEID_PLAYER ? target->ToPlayer() : ToPlayer();
Unit const* creature = target->GetTypeId() == TYPEID_UNIT ? target : this;
if (FactionTemplateEntry const* factionTemplate = creature->getFactionTemplateEntry())
- if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplate->faction))
- if (FactionState const* repState = player->GetReputationMgr().GetState(factionEntry))
- if (!(repState->Flags & FACTION_FLAG_AT_WAR))
- return false;
+ {
+ if (!(player->GetReputationMgr().GetForcedRankIfAny(factionTemplate)))
+ if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplate->faction))
+ if (FactionState const* repState = player->GetReputationMgr().GetState(factionEntry))
+ if (!(repState->Flags & FACTION_FLAG_AT_WAR))
+ return false;
+
+ }
}
}