From 03918978c166c9fb191117a0cae9ba1285bf0e37 Mon Sep 17 00:00:00 2001 From: Meji Date: Sun, 29 Jan 2023 17:42:23 +0100 Subject: Core/Players: Several currency fixes and improvements (#28676) --- src/server/game/Reputation/ReputationMgr.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/server/game/Reputation/ReputationMgr.cpp') diff --git a/src/server/game/Reputation/ReputationMgr.cpp b/src/server/game/Reputation/ReputationMgr.cpp index a90f451d2c9..fb7cbedf0ce 100644 --- a/src/server/game/Reputation/ReputationMgr.cpp +++ b/src/server/game/Reputation/ReputationMgr.cpp @@ -268,7 +268,7 @@ int32 ReputationMgr::GetRenownLevel(FactionEntry const* renownFactionEntry) cons return 0; if (CurrencyTypesEntry const* currency = sCurrencyTypesStore.LookupEntry(renownFactionEntry->RenownCurrencyID)) - return _player->GetCurrency(currency->ID); + return _player->GetCurrencyQuantity(currency->ID); return 0; } @@ -291,7 +291,7 @@ int32 ReputationMgr::GetRenownMaxLevel(FactionEntry const* renownFactionEntry) c return 0; if (CurrencyTypesEntry const* currency = sCurrencyTypesStore.LookupEntry(renownFactionEntry->RenownCurrencyID)) - return currency->MaxQty; + return _player->GetCurrencyMaxQuantity(currency); return 0; } @@ -518,7 +518,7 @@ bool ReputationMgr::SetOneFactionReputation(FactionEntry const* factionEntry, in if (itr != _factions.end()) { // Ignore renown reputation already raised to the maximum level - if (HasMaximumRenownReputation(factionEntry)) + if (HasMaximumRenownReputation(factionEntry) && standing > 0) { itr->second.needSend = false; itr->second.needSave = false; @@ -583,8 +583,9 @@ bool ReputationMgr::SetOneFactionReputation(FactionEntry const* factionEntry, in itr->second.VisualStandingIncrease = reputationChange; + // If the reputation is decreased by command, we will send CurrencyDestroyReason::Cheat if (oldRenownLevel != newRenownLevel) - _player->ModifyCurrency(currency->ID, newRenownLevel - oldRenownLevel, false); + _player->ModifyCurrency(currency->ID, newRenownLevel - oldRenownLevel, CurrencyGainSource::RenownRepGain, CurrencyDestroyReason::Cheat); } } -- cgit v1.2.3