From a6111f811eea73a7087bbbb1e6cde9f1058447a5 Mon Sep 17 00:00:00 2001 From: m Date: Sun, 14 May 2023 03:32:59 -0500 Subject: [PATCH] return if not gsc --- src/client/component/script.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/client/component/script.cpp b/src/client/component/script.cpp index b3a9de14..eae739b0 100644 --- a/src/client/component/script.cpp +++ b/src/client/component/script.cpp @@ -50,14 +50,16 @@ namespace script } 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()) { - 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; }