diff --git a/src/client/component/map_rotation.cpp b/src/client/component/map_rotation.cpp index 1b338dd..10a57f9 100644 --- a/src/client/component/map_rotation.cpp +++ b/src/client/component/map_rotation.cpp @@ -87,6 +87,12 @@ namespace map_rotation ++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) @@ -266,7 +272,7 @@ namespace map_rotation } else { - throw parse_rotation_error(); + throw map_rotation_parse_error(); } } } diff --git a/src/client/component/map_rotation.hpp b/src/client/component/map_rotation.hpp index 195737f..c1620c8 100644 --- a/src/client/component/map_rotation.hpp +++ b/src/client/component/map_rotation.hpp @@ -2,9 +2,9 @@ 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