From a52518d60f958b84d34bd8b01e8a11f2bc3e2c4c Mon Sep 17 00:00:00 2001 From: Nikita Krapivin Date: Mon, 1 Feb 2021 18:50:08 +0500 Subject: [PATCH] WHOOPS! --- .gitignore | 3 ++- libLassebq/GMLua.cpp | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 19ddbbb..5a27da7 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ /libLassebq/Debug /Release /libLassebq/Release -.vs/ \ No newline at end of file +.vs/ +libLassebq.VC.db \ No newline at end of file diff --git a/libLassebq/GMLua.cpp b/libLassebq/GMLua.cpp index 0806996..ece1137 100644 --- a/libLassebq/GMLua.cpp +++ b/libLassebq/GMLua.cpp @@ -579,9 +579,10 @@ void RegisterScripts(lua_State* _pL) { const YYGMLFunc& func = g_GMLScripts[i]; const std::string fname(func.pName); - if (fname.rfind("gml_Script_") != std::string::npos) + const std::string prefix("gml_Script_"); + if (fname.rfind(prefix) != std::string::npos) { - const std::string luaName("GMLScript_" + fname); + const std::string luaName("GMLScript_" + fname.substr(prefix.length())); lua_pushinteger(_pL, i); lua_pushcclosure(_pL, lua_GMLua_script_cclosure, 1); lua_setglobal(_pL, luaName.c_str());