1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-25 13:14:19 +01:00

Codechange: Add format_append as short-hand to format_to + back_inserter.

This commit is contained in:
frosch
2025-04-29 12:37:34 +02:00
committed by frosch
parent 98481ecc01
commit fda93b6f35
12 changed files with 32 additions and 27 deletions

View File

@@ -383,11 +383,11 @@ static void CDECL HandleSavegameLoadCrash(int signum)
for (const auto &c : _grfconfig) {
if (c->flags.Test(GRFConfigFlag::Compatible)) {
const GRFIdentifier &replaced = _gamelog.GetOverriddenIdentifier(*c);
fmt::format_to(std::back_inserter(message), "NewGRF {:08X} (checksum {}) not found.\n Loaded NewGRF \"{}\" (checksum {}) with same GRF ID instead.\n",
format_append(message, "NewGRF {:08X} (checksum {}) not found.\n Loaded NewGRF \"{}\" (checksum {}) with same GRF ID instead.\n",
std::byteswap(c->ident.grfid), FormatArrayAsHex(c->original_md5sum), c->filename, FormatArrayAsHex(replaced.md5sum));
}
if (c->status == GCS_NOT_FOUND) {
fmt::format_to(std::back_inserter(message), "NewGRF {:08X} ({}) not found; checksum {}.\n",
format_append(message, "NewGRF {:08X} ({}) not found; checksum {}.\n",
std::byteswap(c->ident.grfid), c->filename, FormatArrayAsHex(c->ident.md5sum));
}
}