return if not gsc

This commit is contained in:
m 2023-05-14 03:32:59 -05:00
parent 55b74e44a7
commit a6111f811e

View File

@ -50,14 +50,16 @@ namespace script
} }
auto base_name = name; auto base_name = name;
if (utils::string::ends_with(name, ".gsc")) if (!utils::string::ends_with(name, ".gsc"))
{ {
base_name = name.substr(0, name.size() - 4); // .gsc suffix will be readded by Scr_LoadScript printf("GSC script '%s' failed to load due to invalid suffix.\n", name.data());
return;
} }
base_name = name.substr(0, name.size() - 4); // .gsc suffix will be readded by Scr_LoadScript
if (base_name.empty()) if (base_name.empty())
{ {
printf("Not loading GSC script '%s' due to invalid name.\n", name.data()); printf("GSC script '%s' failed to load due to invalid name.\n", name.data());
return; return;
} }