diff --git a/Shared/mods/deathmatch/logic/lua/CLuaFunctionParser.h b/Shared/mods/deathmatch/logic/lua/CLuaFunctionParser.h index 3d5f232e7f..fef13d708b 100644 --- a/Shared/mods/deathmatch/logic/lua/CLuaFunctionParser.h +++ b/Shared/mods/deathmatch/logic/lua/CLuaFunctionParser.h @@ -33,6 +33,8 @@ class LuaFunctionError constexpr bool IsWarning() const noexcept { return m_bWarning; } }; +using LuaVarArgs = std::optional; + struct CLuaFunctionParserBase { // iIndex is passed around by reference @@ -74,6 +76,8 @@ struct CLuaFunctionParserBase } else if constexpr (std::is_same_v) return "value"; + else if constexpr (std::is_same_v) + return "values"; else if constexpr (is_2specialization::value) return "table"; else if constexpr (is_5specialization::value) @@ -219,6 +223,9 @@ struct CLuaFunctionParserBase else if constexpr (std::is_same_v) return iArgument != LUA_TNONE; + else if constexpr (std::is_same_v) + return iArgument != LUA_TNONE; + // All color classes are read as a single tocolor number // Do not be tempted to change this to is_base_of // SColorARGB etc are only **constructors** for SColor! @@ -651,6 +658,12 @@ struct CLuaFunctionParserBase argument.Read(L, index++); return argument; } + else if constexpr (std::is_same_v) + { + CLuaArguments argument; + argument.ReadArguments(L, index); + return argument; + } else if constexpr (std::is_same_v) { return T{};