diff --git a/src/lua/LuaScriptInterface.cpp b/src/lua/LuaScriptInterface.cpp index aa80631a2..6f36ba16a 100644 --- a/src/lua/LuaScriptInterface.cpp +++ b/src/lua/LuaScriptInterface.cpp @@ -1031,7 +1031,11 @@ int LuaScriptInterface::simulation_partCreate(lua_State * l) } int type = lua_tointeger(l, 4); int v = -1; - if (ID(type)) + if (lua_gettop(l) >= 5) + { + v = lua_tointeger(l, 5); + } + else if (ID(type)) { v = ID(type); type = TYP(type);