feat: print warning for invalid gametypes

This commit is contained in:
2024-06-10 20:31:08 +02:00
parent a3fd324479
commit 2d69f181e2
6 changed files with 55 additions and 13 deletions

View File

@@ -21,12 +21,12 @@ namespace
std::string data;
if (!utils::io::read_file(filename, &data) || data.empty())
{
throw std::runtime_error(utils::string::va("'%s' is empty", filename.data()));
throw std::runtime_error(utils::string::va("'%s' is empty", filename.c_str()));
}
if (game::parse_client_effects(data.data()))
{
console::info("Successfully parsed '%s'\n", filename.data());
console::info("Successfully parsed '%s'\n", filename.c_str());
}
}
@@ -41,9 +41,11 @@ namespace
std::string data;
if (!utils::io::read_file(filename, &data) || data.empty())
{
throw std::runtime_error(utils::string::va("'%s' is empty", filename.data()));
throw std::runtime_error(utils::string::va("'%s' is empty", filename.c_str()));
}
console::info("Please ensure that the map rotation is in all lowercase\n");
try
{
map_rotation::rotation_data rotation_data;
@@ -53,7 +55,7 @@ namespace
}
catch (const std::exception& ex)
{
console::error(utils::string::va("%s. '%s' contains invalid data!\n", ex.what(), filename.data()));
console::error(utils::string::va("%s. '%s' contains invalid data!\n", ex.what(), filename.c_str()));
}
}