Skip to content
Permalink
Browse files

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.
  • Loading branch information...
duane-r authored and sapier committed Jan 31, 2017
1 parent 326cc5d commit 3b9ae409c7d7e9445099b86c85392dba4771e08a
Showing with 1 addition and 1 deletion.
  1. +1 −1 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

0 comments on commit 3b9ae40

Please sign in to comment.
You can’t perform that action at this time.