From 907131f5208d7fab7cbafee2f1b5af3b76d1b99e Mon Sep 17 00:00:00 2001 From: Foereaper Date: Sun, 10 Nov 2024 18:58:57 +0100 Subject: [PATCH] Fix wrong type casting --- LuaFunctions.cpp | 50 ++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/LuaFunctions.cpp b/LuaFunctions.cpp index e6abf1ba77..e005de52fc 100644 --- a/LuaFunctions.cpp +++ b/LuaFunctions.cpp @@ -70,31 +70,31 @@ ElunaConstrainedObjectRef GetWeakPtrFor(Vehicle const* obj) #endif #endif -template<> inline int ElunaTemplate::Add(lua_State* L) { return PerformBinaryOp(L, std::plus()); } -template<> inline int ElunaTemplate::Subtract(lua_State* L) { return PerformBinaryOp(L, std::minus()); } -template<> inline int ElunaTemplate::Multiply(lua_State* L) { return PerformBinaryOp(L, std::multiplies()); } -template<> inline int ElunaTemplate::Divide(lua_State* L) { return PerformBinaryOp(L, std::divides()); } -template<> inline int ElunaTemplate::Mod(lua_State* L) { return PerformBinaryOp(L, std::modulus()); } -template<> inline int ElunaTemplate::Equal(lua_State* L) { return PerformBinaryOp(L, std::equal_to()); } -template<> inline int ElunaTemplate::Less(lua_State* L) { return PerformBinaryOp(L, std::less()); } -template<> inline int ElunaTemplate::LessOrEqual(lua_State* L) { return PerformBinaryOp(L, std::less_equal()); } -template<> inline int ElunaTemplate::ToString(lua_State* L) { return ToStringHelper(L); } -template<> inline int ElunaTemplate::Pow(lua_State* L) { return PowHelper(L); } - -template<> inline int ElunaTemplate::Add(lua_State* L) { return PerformBinaryOp(L, std::plus()); } -template<> inline int ElunaTemplate::Subtract(lua_State* L) { return PerformBinaryOp(L, std::minus()); } -template<> inline int ElunaTemplate::Multiply(lua_State* L) { return PerformBinaryOp(L, std::multiplies()); } -template<> inline int ElunaTemplate::Divide(lua_State* L) { return PerformBinaryOp(L, std::divides()); } -template<> inline int ElunaTemplate::Mod(lua_State* L) { return PerformBinaryOp(L, std::modulus()); } -template<> inline int ElunaTemplate::UnaryMinus(lua_State* L) { return PerformUnaryOp(L, std::negate()); } -template<> inline int ElunaTemplate::Equal(lua_State* L) { return PerformBinaryOp(L, std::equal_to()); } -template<> inline int ElunaTemplate::Less(lua_State* L) { return PerformBinaryOp(L, std::less()); } -template<> inline int ElunaTemplate::LessOrEqual(lua_State* L) { return PerformBinaryOp(L, std::less_equal()); } -template<> inline int ElunaTemplate::ToString(lua_State* L) { return ToStringHelper(L); } -template<> inline int ElunaTemplate::Pow(lua_State* L) { return PowHelper(L); } - -template<> inline int ElunaTemplate::Equal(lua_State* L) { Eluna* E = Eluna::GetEluna(L); E->Push(E->CHECKVAL(1) == E->CHECKVAL(2)); return 1; } -template<> inline int ElunaTemplate::ToString(lua_State* L) +template<> int ElunaTemplate::Add(lua_State* L) { return PerformBinaryOp(L, std::plus()); } +template<> int ElunaTemplate::Subtract(lua_State* L) { return PerformBinaryOp(L, std::minus()); } +template<> int ElunaTemplate::Multiply(lua_State* L) { return PerformBinaryOp(L, std::multiplies()); } +template<> int ElunaTemplate::Divide(lua_State* L) { return PerformBinaryOp(L, std::divides()); } +template<> int ElunaTemplate::Mod(lua_State* L) { return PerformBinaryOp(L, std::modulus()); } +template<> int ElunaTemplate::Equal(lua_State* L) { return PerformBinaryOp(L, std::equal_to()); } +template<> int ElunaTemplate::Less(lua_State* L) { return PerformBinaryOp(L, std::less()); } +template<> int ElunaTemplate::LessOrEqual(lua_State* L) { return PerformBinaryOp(L, std::less_equal()); } +template<> int ElunaTemplate::ToString(lua_State* L) { return ToStringHelper(L); } +template<> int ElunaTemplate::Pow(lua_State* L) { return PowHelper(L); } + +template<> int ElunaTemplate::Add(lua_State* L) { return PerformBinaryOp(L, std::plus()); } +template<> int ElunaTemplate::Subtract(lua_State* L) { return PerformBinaryOp(L, std::minus()); } +template<> int ElunaTemplate::Multiply(lua_State* L) { return PerformBinaryOp(L, std::multiplies()); } +template<> int ElunaTemplate::Divide(lua_State* L) { return PerformBinaryOp(L, std::divides()); } +template<> int ElunaTemplate::Mod(lua_State* L) { return PerformBinaryOp(L, std::modulus()); } +template<> int ElunaTemplate::UnaryMinus(lua_State* L) { return PerformUnaryOp(L, std::negate()); } +template<> int ElunaTemplate::Equal(lua_State* L) { return PerformBinaryOp(L, std::equal_to()); } +template<> int ElunaTemplate::Less(lua_State* L) { return PerformBinaryOp(L, std::less()); } +template<> int ElunaTemplate::LessOrEqual(lua_State* L) { return PerformBinaryOp(L, std::less_equal()); } +template<> int ElunaTemplate::ToString(lua_State* L) { return ToStringHelper(L); } +template<> int ElunaTemplate::Pow(lua_State* L) { return PowHelper(L); } + +template<> int ElunaTemplate::Equal(lua_State* L) { Eluna* E = Eluna::GetEluna(L); E->Push(E->CHECKVAL(1) == E->CHECKVAL(2)); return 1; } +template<> int ElunaTemplate::ToString(lua_State* L) { Eluna* E = Eluna::GetEluna(L); #if defined ELUNA_TRINITY