diff --git a/src/lua/callbacks/events_callbacks.hpp b/src/lua/callbacks/events_callbacks.hpp index 9b80dabd93a..032b6bef28f 100644 --- a/src/lua/callbacks/events_callbacks.hpp +++ b/src/lua/callbacks/events_callbacks.hpp @@ -90,8 +90,7 @@ class EventsCallbacks { void executeCallback(EventCallback_t eventType, CallbackFunc callbackFunc, Args &&... args) { for (const auto &[name, callback] : getCallbacksByType(eventType)) { if (callback && callback->isLoadedCallback()) { - std::invoke(callbackFunc, *callback, std::forward(args)...); - // g_logger().trace("Executed callback: {}", name); + std::invoke(callbackFunc, *callback, args...); } } } @@ -107,7 +106,7 @@ class EventsCallbacks { ReturnValue checkCallbackWithReturnValue(EventCallback_t eventType, CallbackFunc callbackFunc, Args &&... args) { for (const auto &[name, callback] : getCallbacksByType(eventType)) { if (callback && callback->isLoadedCallback()) { - ReturnValue callbackResult = std::invoke(callbackFunc, *callback, std::forward(args)...); + ReturnValue callbackResult = std::invoke(callbackFunc, *callback, args...); if (callbackResult != RETURNVALUE_NOERROR) { return callbackResult; } @@ -128,7 +127,7 @@ class EventsCallbacks { bool allCallbacksSucceeded = true; for (const auto &[name, callback] : getCallbacksByType(eventType)) { if (callback && callback->isLoadedCallback()) { - bool callbackResult = std::invoke(callbackFunc, *callback, std::forward(args)...); + bool callbackResult = std::invoke(callbackFunc, *callback, args...); allCallbacksSucceeded &= callbackResult; } }