mirror of
https://github.com/minetest/minetest.git
synced 2024-08-19 04:54:18 +02:00
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);
|
||||
|
||||
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);
|
||||
lua_pop(L, 2); // Pop object and error handler
|
||||
|
Loading…
Reference in New Issue
Block a user