1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-17 17:32:45 +01:00

Codechange: Use GetString() with argument parameters in simple cases. (#13551)

Avoids using global string parameters.
This commit is contained in:
Peter Nelson
2025-02-14 00:10:56 +00:00
committed by GitHub
parent c3d5e6d2a0
commit 20e57a02a2
26 changed files with 79 additions and 170 deletions

View File

@@ -68,9 +68,7 @@ int8_t SaveHighScoreValue(const Company *c)
std::move_backward(it, highscores.end() - 1, highscores.end());
/* Fill the elements. */
SetDParam(0, c->index);
SetDParam(1, c->index);
it->name = GetString(STR_HIGHSCORE_NAME); // get manager/company name string
it->name = GetString(STR_HIGHSCORE_NAME, c->index, c->index); // get manager/company name string
it->score = score;
it->title = EndGameGetPerformanceTitleFromValue(score);
return std::distance(highscores.begin(), it);
@@ -104,9 +102,7 @@ int8_t SaveHighScoreValueNetwork()
for (size_t i = 0; i < count && i < highscores.size(); i++) {
const Company *c = cl[i];
auto &highscore = highscores[i];
SetDParam(0, c->index);
SetDParam(1, c->index);
highscore.name = GetString(STR_HIGHSCORE_NAME); // get manager/company name string
highscore.name = GetString(STR_HIGHSCORE_NAME, c->index, c->index); // get manager/company name string
highscore.score = c->old_economy[0].performance_history;
highscore.title = EndGameGetPerformanceTitleFromValue(highscore.score);