Skip to content

Commit

Permalink
Fix range-loop-construct warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
Pentarctagon committed Apr 24, 2022
1 parent ed12d7a commit 8a8b3c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/generators/lua_map_generator.cpp
Expand Up @@ -38,14 +38,14 @@ lua_map_generator::lua_map_generator(const config & cfg, const config* vars)
{
lk_.load_core();
const std::array required {"id", "config_name", "create_map"};
for(const std::string& req : required) {
for(const char* const req : required) {
if (!cfg.has_attribute(req)) {
if(req == "create_map" && cfg.has_attribute("create_scenario")) {
// One of these is required, but not both
continue;
}
std::string msg = "Error when constructing a lua map generator -- missing a required attribute '";
msg += req + "'\n";
msg += req + std::string("'\n");
msg += "Config was '" + cfg.debug() + "'";
throw mapgen_exception(msg);
}
Expand Down

0 comments on commit 8a8b3c4

Please sign in to comment.