diff --git a/src/properties/stringlistproperty.cpp b/src/properties/stringlistproperty.cpp index 168298a8f4..b3ce643791 100644 --- a/src/properties/stringlistproperty.cpp +++ b/src/properties/stringlistproperty.cpp @@ -58,7 +58,7 @@ bool toLuaConversion(lua_State* state, std::vector val) { int i = 1; for (std::string& v : val) { - lua_pushstring(state, std::to_string(i).c_str()); + lua_pushnumber(state, i); lua_pushstring(state, v.c_str()); lua_settable(state, -3); ++i; diff --git a/src/scripting/scriptengine.cpp b/src/scripting/scriptengine.cpp index c8a93bbc5f..a00f3d72dd 100644 --- a/src/scripting/scriptengine.cpp +++ b/src/scripting/scriptengine.cpp @@ -274,6 +274,7 @@ void ScriptEngine::addLibraryFunctions(lua_State* state, LuaLibrary& library, ghoul::lua::runScriptFile(state, absPath(script)); library.documentations.clear(); + // Then, we extract the documentation information from the file lua_pushstring(state, "documentation"); lua_gettable(state, -2); @@ -303,10 +304,9 @@ void ScriptEngine::addLibraryFunctions(lua_State* state, LuaLibrary& library, lua_pop(state, 1); library.documentations.push_back({ name, arguments, documentation }); - } - lua_pop(state, 1); } + lua_pop(state, 1); } }