From e36497aef57899f18e0d55c0640bfd96e2251a8e Mon Sep 17 00:00:00 2001 From: xinef1 Date: Thu, 2 Mar 2017 00:10:15 +0100 Subject: Core/Misc: Always reward all necessary reputations on creature kill (#19106) (cherry picked from commit fb2aebe46be7439a8f9b99067edb27fd844c1a28) --- src/server/game/Reputation/ReputationMgr.cpp | 7 +++++-- src/server/game/Reputation/ReputationMgr.h | 8 ++++---- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'src/server/game/Reputation') diff --git a/src/server/game/Reputation/ReputationMgr.cpp b/src/server/game/Reputation/ReputationMgr.cpp index 1c362984ecc..b017947d56c 100644 --- a/src/server/game/Reputation/ReputationMgr.cpp +++ b/src/server/game/Reputation/ReputationMgr.cpp @@ -267,7 +267,7 @@ void ReputationMgr::Initialize() } } -bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standing, bool incremental, bool noSpillover) +bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standing, bool incremental, bool spillOverOnly, bool noSpillover) { sScriptMgr->OnPlayerReputationChange(_player, factionEntry->ID, standing, incremental); bool res = false; @@ -334,7 +334,10 @@ bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standi FactionStateList::iterator faction = _factions.find(factionEntry->ReputationIndex); if (faction != _factions.end()) { - res = SetOneFactionReputation(factionEntry, standing, incremental); + // if we update spillover only, do not update main reputation (rank exceeds creature reward rate) + if (!spillOverOnly) + res = SetOneFactionReputation(factionEntry, standing, incremental); + // only this faction gets reported to client, even if it has no own visible standing SendState(&faction->second); } diff --git a/src/server/game/Reputation/ReputationMgr.h b/src/server/game/Reputation/ReputationMgr.h index 3ad0958107c..ffc9ad826b5 100644 --- a/src/server/game/Reputation/ReputationMgr.h +++ b/src/server/game/Reputation/ReputationMgr.h @@ -118,11 +118,11 @@ class TC_GAME_API ReputationMgr public: // modifiers bool SetReputation(FactionEntry const* factionEntry, int32 standing) { - return SetReputation(factionEntry, standing, false, false); + return SetReputation(factionEntry, standing, false, false, false); } - bool ModifyReputation(FactionEntry const* factionEntry, int32 standing, bool noSpillover = false) + bool ModifyReputation(FactionEntry const* factionEntry, int32 standing, bool spillOverOnly = false, bool noSpillover = false) { - return SetReputation(factionEntry, standing, true, noSpillover); + return SetReputation(factionEntry, standing, true, spillOverOnly, noSpillover); } void SetVisible(FactionTemplateEntry const* factionTemplateEntry); @@ -144,7 +144,7 @@ class TC_GAME_API ReputationMgr private: // internal helper functions void Initialize(); uint32 GetDefaultStateFlags(FactionEntry const* factionEntry) const; - bool SetReputation(FactionEntry const* factionEntry, int32 standing, bool incremental, bool noSpillover); + bool SetReputation(FactionEntry const* factionEntry, int32 standing, bool incremental, bool spillOverOnly, bool noSpillover); void SetVisible(FactionState* faction); void SetAtWar(FactionState* faction, bool atWar) const; void SetInactive(FactionState* faction, bool inactive) const; -- cgit v1.2.3