aboutsummaryrefslogtreecommitdiff
path: root/src/game/SpellAuras.cpp
diff options
context:
space:
mode:
authorn0n4m3 <none@none>2009-12-26 09:43:39 +0100
committern0n4m3 <none@none>2009-12-26 09:43:39 +0100
commitcd9f84aae50e9d05bb432a42629965e5eff9222f (patch)
tree7b88af77b396c262df03c0b79f4fd02b958398c7 /src/game/SpellAuras.cpp
parent3796af3658a6c70ce0209ede98dea2b5b326ed8f (diff)
Implement expected combat stop with friendly faction. by VladimirMangos
--HG-- branch : trunk
Diffstat (limited to 'src/game/SpellAuras.cpp')
-rw-r--r--src/game/SpellAuras.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index faa8c3407dc..f3352d015a2 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -3925,10 +3925,14 @@ void AuraEffect::HandleForceReaction(bool apply, bool Real, bool changeAmount)
Player* player = (Player*)m_target;
uint32 faction_id = GetMiscValue();
- uint32 faction_rank = m_amount;
+ ReputationRank faction_rank = ReputationRank(m_amount);
- player->GetReputationMgr().ApplyForceReaction(faction_id,ReputationRank(faction_rank),apply);
+ player->GetReputationMgr().ApplyForceReaction(faction_id,faction_rank,apply);
player->GetReputationMgr().SendForceReactions();
+
+ // stop fighting if at apply forced rank friendly or at remove real rank friendly
+ if (apply && faction_rank >= REP_FRIENDLY || !apply && player->GetReputationRank(faction_id) >= REP_FRIENDLY)
+ player->StopAttackFaction(faction_id);
}
void AuraEffect::HandleAuraModSkill(bool apply, bool Real, bool /*changeAmount*/)