Skip to content


Tell on_punch to expect a return value
Browse files Browse the repository at this point in the history
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 Feb 1, 2017
1 parent 326cc5d commit 3b9ae40
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/script/cpp_api/s_entity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ bool ScriptApiEntity::luaentity_Punch(u16 id,
lua_pushnumber(L, damage);

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
Expand Down

0 comments on commit 3b9ae40

Please sign in to comment.