diff --git a/Changelog.md b/Changelog.md index 7166f09..a630190 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,7 +1,7 @@ # v2.4.0 - CHANGED entire plugin Lua implementation (rewrite) -- CHANGED moved *almost all* functions into MP.\* +- CHANGED moved *almost all* Lua functions into MP.\* - CHANGED console to use a custom language (type `help`, `list`, or `status`!) - CHANGED all files of a Lua plugin to share a Lua state (no more state-per-file) - ADDED many new Lua API functions, which can be found at @@ -14,7 +14,7 @@ - ADDED dumping tables with `print()` (try it with `print(MP)`) - ADDED `MP.GetOSName()`, `MP.CreateTimer()`, `MP.GetLuaMemoryUsage()` and many more (see ) - ADDED `MP.Settings` table to make usage of `MP.Set()` easier -- ADDED `FS.*` table with common filesystem operations +- ADDED `FS.*` table with common filesystem operations (do `print(FS)` to see them!) - FIXED i/o thread spin when stdout is /dev/null on linux - FIXED removed extra whitespace infront of onChatMessage message diff --git a/include/Common.h b/include/Common.h index 5772317..b75caef 100644 --- a/include/Common.h +++ b/include/Common.h @@ -114,7 +114,7 @@ private: static inline std::mutex mShutdownHandlersMutex {}; static inline std::deque mShutdownHandlers {}; - static inline Version mVersion { 2, 4, 0 }; + static inline Version mVersion { 3, 0, 0 }; }; std::string ThreadName(bool DebugModeOverride = false); diff --git a/include/TLuaEngine.h b/include/TLuaEngine.h index 3b2e070..1673c61 100644 --- a/include/TLuaEngine.h +++ b/include/TLuaEngine.h @@ -133,10 +133,12 @@ public: } std::vector> Results; + std::vector Arguments { TLuaArgTypes { std::forward(Args) }... }; + for (const auto& Event : mLuaEvents.at(EventName)) { for (const auto& Function : Event.second) { if (Event.first != IgnoreId) { - Results.push_back(EnqueueFunctionCall(Event.first, Function, { TLuaArgTypes { std::forward(Args) }... })); + Results.push_back(EnqueueFunctionCall(Event.first, Function, Arguments)); } } }