fix: general moment

This commit is contained in:
Diavolo 2023-02-20 16:44:45 +01:00
parent 568ab4ee92
commit ee4efc778c
No known key found for this signature in database
GPG Key ID: FA77F074E98D98A5

View File

@ -170,10 +170,14 @@ namespace gsc
const auto* script_file = files[i];
console::info("Loading script %s...\n", script_file);
sprintf_s(path, "%s/%s", "scripts", script_file);
const auto len = sprintf_s(path, "%s/%s", "scripts", script_file);
if (len == -1)
{
continue;
}
// Scr_LoadScriptInternal will add the '.gsc' suffix so we remove it
path[std::strlen(path) - 4] = '\0';
path[len - 4] = '\0';
if (!game::native::Scr_LoadScript(path))
{