From d6aa09f96a7b05e18ce61c4a6362bf954aab4f9e Mon Sep 17 00:00:00 2001 From: Da-W1nn3r <70009882+Da-W1nn3r@users.noreply.github.com> Date: Mon, 14 Oct 2024 16:57:07 +1100 Subject: [PATCH] Fix #12973: Don't exclude high score after using sandbox --- src/cheat.cpp | 17 ----------------- src/cheat_func.h | 1 - src/highscore.cpp | 3 --- 3 files changed, 21 deletions(-) diff --git a/src/cheat.cpp b/src/cheat.cpp index 9fba889da0..30adc36fbe 100644 --- a/src/cheat.cpp +++ b/src/cheat.cpp @@ -20,20 +20,3 @@ void InitializeCheats() { memset(&_cheats, 0, sizeof(Cheats)); } - -/** - * Return true if any cheat has been used, false otherwise - * @return has a cheat been used? - */ -bool CheatHasBeenUsed() -{ - /* Cannot use lengthof because _cheats is of type Cheats, not Cheat */ - const Cheat *cht = (Cheat*)&_cheats; - const Cheat *cht_last = &cht[sizeof(_cheats) / sizeof(Cheat)]; - - for (; cht != cht_last; cht++) { - if (cht->been_used) return true; - } - - return false; -} diff --git a/src/cheat_func.h b/src/cheat_func.h index 6d26e71c4a..5c205b04bd 100644 --- a/src/cheat_func.h +++ b/src/cheat_func.h @@ -16,6 +16,5 @@ extern Cheats _cheats; void ShowCheatWindow(); -bool CheatHasBeenUsed(); #endif /* CHEAT_FUNC_H */ diff --git a/src/highscore.cpp b/src/highscore.cpp index 4ae061d89f..63fe367039 100644 --- a/src/highscore.cpp +++ b/src/highscore.cpp @@ -56,9 +56,6 @@ StringID EndGameGetPerformanceTitleFromValue(uint value) */ int8_t SaveHighScoreValue(const Company *c) { - /* Exclude cheaters from the honour of being in the highscore table */ - if (CheatHasBeenUsed()) return -1; - auto &highscores = _highscore_table[SP_CUSTOM]; uint16_t score = c->old_economy[0].performance_history; -- 2.11.4.GIT