maint(map_rotation): add error msg if no map in rotation

This commit is contained in:
Diavolo 2023-01-10 00:02:28 +01:00
parent 5667ab0a1a
commit 02e187b843
No known key found for this signature in database
GPG Key ID: FA77F074E98D98A5
2 changed files with 9 additions and 3 deletions

View File

@ -87,6 +87,12 @@ namespace map_rotation
++i; ++i;
} }
if (i == rotation.get_entries_size())
{
console::error("Map rotation does not contain any map. Restarting\n");
launch_default_map();
}
} }
void load_rotation(const std::string& data) void load_rotation(const std::string& data)
@ -266,7 +272,7 @@ namespace map_rotation
} }
else else
{ {
throw parse_rotation_error(); throw map_rotation_parse_error();
} }
} }
} }

View File

@ -2,9 +2,9 @@
namespace map_rotation namespace map_rotation
{ {
struct parse_rotation_error : public std::exception struct map_rotation_parse_error : public std::exception
{ {
const char* what() const noexcept override { return "Parse Rotation Error"; } [[nodiscard]] const char* what() const noexcept override { return "Map Rotation Parse Erro"; }
}; };
class rotation_data class rotation_data