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;
|
y = TileY(tile) + dy;
|
||||||
|
|
||||||
if (x >= Map::SizeX() || y >= Map::SizeY()) {
|
if (x >= Map::SizeX() || y >= Map::SizeY()) {
|
||||||
char buf[512];
|
std::string message = fmt::format("TILE_ADD({}) when adding 0x{:04X} and 0x{%04X} failed",
|
||||||
|
|
||||||
seprintf(buf, lastof(buf), "TILE_ADD(%s) when adding 0x%.4X and 0x%.4X failed",
|
|
||||||
exp, (uint32)tile, add);
|
exp, (uint32)tile, add);
|
||||||
#if !defined(_MSC_VER)
|
#if !defined(_MSC_VER)
|
||||||
fmt::print(stderr, "{}:{} {}\n", file, line, buf);
|
fmt::print(stderr, "{}:{} {}\n", file, line, message);
|
||||||
#else
|
#else
|
||||||
_assert(buf, (char*)file, line);
|
_assert(message.data(), (char*)file, line);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue