From 3b9ae409c7d7e9445099b86c85392dba4771e08a Mon Sep 17 00:00:00 2001 From: Duane Robertson Date: Mon, 30 Jan 2017 22:37:04 -0600 Subject: [PATCH] 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. --- src/script/cpp_api/s_entity.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.25.1