mirror of https://github.com/OpenTTD/OpenTTD
Codechange: use fmt::format to construct error message
parent
4de9b8a988
commit
5e9a1eb790
|
@ -82,14 +82,12 @@ TileIndex TileAdd(TileIndex tile, TileIndexDiff add,
|
|||
y = TileY(tile) + dy;
|
||||
|
||||
if (x >= Map::SizeX() || y >= Map::SizeY()) {
|
||||
char buf[512];
|
||||
|
||||
seprintf(buf, lastof(buf), "TILE_ADD(%s) when adding 0x%.4X and 0x%.4X failed",
|
||||
std::string message = fmt::format("TILE_ADD({}) when adding 0x{:04X} and 0x{%04X} failed",
|
||||
exp, (uint32)tile, add);
|
||||
#if !defined(_MSC_VER)
|
||||
fmt::print(stderr, "{}:{} {}\n", file, line, buf);
|
||||
fmt::print(stderr, "{}:{} {}\n", file, line, message);
|
||||
#else
|
||||
_assert(buf, (char*)file, line);
|
||||
_assert(message.data(), (char*)file, line);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue