Best I can do to simplify the check(fmt::format)crap is to make a little macro to do the format part.

This commit is contained in:
Zed A. Shaw 2026-03-05 12:39:22 -05:00
parent 6710469ee1
commit f0b04107ab
28 changed files with 108 additions and 108 deletions

View file

@ -22,9 +22,9 @@ void WorldBuilder::stylize_rooms() {
auto& style = styles[Random::uniform(size_t(0), styles.size() - 1)];
dbc::check(style.contains("floor"),
fmt::format("no floor spec in style {}", (std::string)style["name"]));
$F("no floor spec in style {}", (std::string)style["name"]));
dbc::check(style.contains("walls"),
fmt::format("no walls spec in style {}", (std::string)style["name"]));
$F("no walls spec in style {}", (std::string)style["name"]));
auto& floor_name = style["floor"];
auto& wall_name = style["walls"];
@ -79,7 +79,7 @@ bool WorldBuilder::find_open_spot(Point& pos_out) {
matrix::dump("FAIL PLACE!", $map.walls(), pos_out.x, pos_out.y);
dbc::sentinel(fmt::format("failed to place entity in the entire map?: i={}; width={};", i, $map.width()));
dbc::sentinel($F("failed to place entity in the entire map?: i={}; width={};", i, $map.width()));
return false;
}