Changeset - r27546:cc50bde3b648
[Not reviewed]
master
0 1 0
Rubidium - 15 months ago 2023-06-06 15:09:57
rubidium@openttd.org
Codechange: use fmt::format to construct error message
1 file changed with 3 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/map.cpp
Show inline comments
 
@@ -82,14 +82,12 @@ TileIndex TileAdd(TileIndex tile, TileIn
 
	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
 
	}
 

	
0 comments (0 inline, 0 general)