Skip to content

Commit

Permalink
Better error message when generating heal_locations.h fails
Browse files Browse the repository at this point in the history
  • Loading branch information
GriffinRichards committed Sep 19, 2024
1 parent 3ace518 commit f214df9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/mapjson/mapjson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,10 +382,10 @@ void process_heal_locations(const vector<string> &map_filepaths, string output_f
string map_json_text = read_text_file(filepath);
Json map_data = Json::parse(map_json_text, err);
if (map_data == Json())
FATAL_ERROR("%s\n", err.c_str());
FATAL_ERROR("Failed to read '%s' while generating '%s': %s\n", filepath.c_str(), output_file.c_str(), err.c_str());

// Skip if no heal locations present
if (map_data.object_items().find("heal_locations") == map_data.object_items().end() || map_data["heal_locations"].array_items().size() < 0)
if (map_data.object_items().find("heal_locations") == map_data.object_items().end() || map_data["heal_locations"].array_items().size() <= 0)
continue;

string map_id = json_to_string(map_data, "id");
Expand Down

0 comments on commit f214df9

Please sign in to comment.