CPlayerState: Make GetPickupTotal() a const member function

This doesn't modify internal member state.
This commit is contained in:
Lioncash 2020-05-19 22:25:22 -04:00
parent 9ce7c72a1c
commit e73e704d20
2 changed files with 3 additions and 3 deletions

View File

@ -119,7 +119,7 @@ public:
CHealthInfo& GetHealthInfo();
const CHealthInfo& GetHealthInfo() const;
u32 GetPickupTotal() { return 99; }
u32 GetPickupTotal() const { return 99; }
void SetIsFusionEnabled(bool val) { x0_26_fusion = val; }
bool IsFusionEnabled() const { return x0_26_fusion; }
EPlayerSuit GetCurrentSuit() const;

View File

@ -692,8 +692,8 @@ void CMain::UpdateDiscordPresence(CAssetId worldSTRG) {
}
if (g_GameState != nullptr) {
if (CPlayerState* pState = g_GameState->GetPlayerState().get()) {
u32 itemPercent = pState->CalculateItemCollectionRate() * 100 / pState->GetPickupTotal();
if (const CPlayerState* pState = g_GameState->GetPlayerState().get()) {
const u32 itemPercent = pState->CalculateItemCollectionRate() * 100 / pState->GetPickupTotal();
if (DiscordItemPercent != itemPercent) {
DiscordItemPercent = itemPercent;
DiscordState = fmt::format(FMT_STRING("{}%"), itemPercent);