mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
Eluna misc fixes
This commit is contained in:
@@ -68,6 +68,7 @@ ENDCALL();
|
|||||||
uint32 _LuaEvent = EVENT; \
|
uint32 _LuaEvent = EVENT; \
|
||||||
int _LuaStackTop = lua_gettop(L); \
|
int _LuaStackTop = lua_gettop(L); \
|
||||||
lua_rawgeti(L, LUA_REGISTRYINDEX, _Luabind); \
|
lua_rawgeti(L, LUA_REGISTRYINDEX, _Luabind); \
|
||||||
|
int _LuaFuncTop = lua_gettop(L); \
|
||||||
Eluna::Push(L, _LuaEvent);
|
Eluna::Push(L, _LuaEvent);
|
||||||
|
|
||||||
#define ENTRY_EXECUTE(RETVALS) \
|
#define ENTRY_EXECUTE(RETVALS) \
|
||||||
@@ -83,7 +84,7 @@ ENDCALL();
|
|||||||
{ \
|
{ \
|
||||||
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) \
|
if (_LuaReturnValues != LUA_MULTRET && lua_gettop(L) > _LuaStackTop + (_LuaFuncTop-_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); \
|
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); \
|
||||||
} \
|
} \
|
||||||
|
|||||||
@@ -1966,7 +1966,7 @@ namespace LuaPlayer
|
|||||||
if (!item)
|
if (!item)
|
||||||
{
|
{
|
||||||
uint32 itemId = Eluna::CHECKVAL<uint32>(L, 2);
|
uint32 itemId = Eluna::CHECKVAL<uint32>(L, 2);
|
||||||
player->DestroyItemCount(itemId, itemCount, true);
|
player->DestroyItemCount(itemId, itemCount, false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
player->DestroyItemCount(item, itemCount, true);
|
player->DestroyItemCount(item, itemCount, true);
|
||||||
|
|||||||
Reference in New Issue
Block a user