Merge pull request #785 from diamante0018/develop
[Script]: Optimize loading
This commit is contained in:
commit
f9f817fc9d
@ -55,10 +55,14 @@ namespace Components
|
|||||||
const auto* scriptFile = files[i];
|
const auto* scriptFile = files[i];
|
||||||
Logger::Print("Loading script {}...\n", scriptFile);
|
Logger::Print("Loading script {}...\n", scriptFile);
|
||||||
|
|
||||||
sprintf_s(path, "%s/%s", "scripts", scriptFile);
|
const auto len = sprintf_s(path, "%s/%s", "scripts", scriptFile);
|
||||||
|
if (len == -1)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Scr_LoadScriptInternal will add the '.gsc' suffix so we remove it
|
// Scr_LoadScriptInternal will add the '.gsc' suffix so we remove it
|
||||||
path[std::strlen(path) - 4] = '\0';
|
path[len - 4] = '\0';
|
||||||
|
|
||||||
if (!Game::Scr_LoadScript(path))
|
if (!Game::Scr_LoadScript(path))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user