mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
Update LuaEngine.h
Made the error to return right amount of nils in any case.
This commit is contained in:
@@ -273,12 +273,8 @@ public:
|
||||
int args = lua_gettop(L);
|
||||
int expected = l->mfunc(L, obj);
|
||||
args = lua_gettop(L) - args;
|
||||
if (args <= 0 || args > expected)
|
||||
{
|
||||
if (args < 0 || args > expected) // Assert instead?
|
||||
ELUNA_LOG_ERROR("[Eluna]: %s returned unexpected amount of arguments %i out of %i. Report to devs", l->name, args, expected);
|
||||
return expected;
|
||||
}
|
||||
if (args < 0 || args > expected) // Assert instead?
|
||||
ELUNA_LOG_ERROR("[Eluna]: %s returned unexpected amount of arguments %i out of %i. Report to devs", l->name, args, expected);
|
||||
for (; args < expected; ++args)
|
||||
lua_pushnil(L);
|
||||
return expected;
|
||||
|
||||
Reference in New Issue
Block a user