aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Reputation/ReputationMgr.cpp
diff options
context:
space:
mode:
authorMeji <alvaro.megias@outlook.com>2023-01-29 17:42:23 +0100
committerGitHub <noreply@github.com>2023-01-29 17:42:23 +0100
commit03918978c166c9fb191117a0cae9ba1285bf0e37 (patch)
tree4eb31986b057483a11d39c826b3deb9dc0f4f35b /src/server/game/Reputation/ReputationMgr.cpp
parentb6cd49c34d4d02b41ced58b87103123a1532b56c (diff)
Core/Players: Several currency fixes and improvements (#28676)
Diffstat (limited to 'src/server/game/Reputation/ReputationMgr.cpp')
-rw-r--r--src/server/game/Reputation/ReputationMgr.cpp9
1 files changed, 5 insertions, 4 deletions
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);
}
}