From: Duane Robertson Date: Tue, 31 Jan 2017 04:37:04 +0000 (-0600) Subject: Tell on_punch to expect a return value X-Git-Tag: 0.4.16~469 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=3b9ae409c7d7e9445099b86c85392dba4771e08a;p=oweals%2Fminetest.git 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. --- diff --git a/src/script/cpp_api/s_entity.cpp b/src/script/cpp_api/s_entity.cpp index fcd8dd4a0..9e2193970 100644 --- a/src/script/cpp_api/s_entity.cpp +++ b/src/script/cpp_api/s_entity.cpp @@ -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