Merge remote-tracking branch 'origin/master' into 4.3.4
Conflicts: src/server/game/Achievements/AchievementMgr.cpp src/server/game/Spells/SpellInfo.cpp src/server/scripts/Commands/cs_misc.cpp
This commit is contained in:
commit
5ee22a8006
15 files changed
+44
-43
No files matched your search
@@ -11051,19 +11051,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;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user