aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuane Robertson <duane@duanerobertson.com>2017-01-30 22:37:04 -0600
committersapier <sapier at gmx dot net>2017-02-01 22:13:49 +0100
commit3b9ae409c7d7e9445099b86c85392dba4771e08a (patch)
tree7afbe80111243a30ac1b4584e3df47ec1338e929
parent326cc5df741120dcfdfef21a7acaef5322601764 (diff)
downloadminetest-3b9ae409c7d7e9445099b86c85392dba4771e08a.tar.gz
minetest-3b9ae409c7d7e9445099b86c85392dba4771e08a.tar.bz2
minetest-3b9ae409c7d7e9445099b86c85392dba4771e08a.zip
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.
-rw-r--r--src/script/cpp_api/s_entity.cpp2
1 files changed, 1 insertions, 1 deletions
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