Tell on_punch to expect a return value
The return value should be interpreted as a boolean saying whether the lua on_punch function handled damage or the system needs to.
This commit is contained in:
parent
326cc5df74
commit
3b9ae409c7
|
@ -254,7 +254,7 @@ bool ScriptApiEntity::luaentity_Punch(u16 id,
|
||||||
lua_pushnumber(L, damage);
|
lua_pushnumber(L, damage);
|
||||||
|
|
||||||
setOriginFromTable(object);
|
setOriginFromTable(object);
|
||||||
PCALL_RES(lua_pcall(L, 6, 0, error_handler));
|
PCALL_RES(lua_pcall(L, 6, 1, error_handler));
|
||||||
|
|
||||||
bool retval = lua_toboolean(L, -1);
|
bool retval = lua_toboolean(L, -1);
|
||||||
lua_pop(L, 2); // Pop object and error handler
|
lua_pop(L, 2); // Pop object and error handler
|
||||||
|
|
Loading…
Reference in New Issue