mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
Eluna fix invalid errors
This commit is contained in:
10
HookMgr.cpp
10
HookMgr.cpp
@@ -79,14 +79,14 @@ ENDCALL();
|
|||||||
for (int IT = _LuaStackTop + 1; IT <= lua_gettop(L); ++IT)
|
for (int IT = _LuaStackTop + 1; IT <= lua_gettop(L); ++IT)
|
||||||
|
|
||||||
#define ENDCALL() \
|
#define ENDCALL() \
|
||||||
if (_LuaReturnValues != LUA_MULTRET && lua_gettop(L) != _LuaStackTop + _LuaReturnValues) \
|
if (lua_gettop(L) < _LuaStackTop) \
|
||||||
{ \
|
|
||||||
ELUNA_LOG_ERROR("[Eluna]: Ending event %u for %s, stack top was %i and was supposed to be %i. Report to devs", _LuaEvent, _LuaBindType, lua_gettop(L), _LuaStackTop + _LuaReturnValues); \
|
|
||||||
} \
|
|
||||||
else if (_LuaReturnValues == LUA_MULTRET && lua_gettop(L) < _LuaStackTop) \
|
|
||||||
{ \
|
{ \
|
||||||
ELUNA_LOG_ERROR("[Eluna]: Ending event %u for %s, stack top was %i and was supposed to be >= %i. Report to devs", _LuaEvent, _LuaBindType, lua_gettop(L), _LuaStackTop); \
|
ELUNA_LOG_ERROR("[Eluna]: Ending event %u for %s, stack top was %i and was supposed to be >= %i. Report to devs", _LuaEvent, _LuaBindType, lua_gettop(L), _LuaStackTop); \
|
||||||
} \
|
} \
|
||||||
|
if (_LuaReturnValues != LUA_MULTRET && lua_gettop(L) > _LuaStackTop + _LuaReturnValues) \
|
||||||
|
{ \
|
||||||
|
ELUNA_LOG_ERROR("[Eluna]: Ending event %u for %s, stack top was %i and was supposed to be between %i and %i. Report to devs", _LuaEvent, _LuaBindType, lua_gettop(L), _LuaStackTop, _LuaStackTop + _LuaReturnValues); \
|
||||||
|
} \
|
||||||
lua_settop(L, _LuaStackTop);
|
lua_settop(L, _LuaStackTop);
|
||||||
|
|
||||||
void Eluna::OnLuaStateClose()
|
void Eluna::OnLuaStateClose()
|
||||||
|
|||||||
Reference in New Issue
Block a user