Skip to content

Commit 3b9ae40

Browse files
duane-rsapier
authored and
sapier
committedFeb 1, 2017
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.
1 parent 326cc5d commit 3b9ae40

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

Diff for: ‎src/script/cpp_api/s_entity.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ bool ScriptApiEntity::luaentity_Punch(u16 id,
254254
lua_pushnumber(L, damage);
255255

256256
setOriginFromTable(object);
257-
PCALL_RES(lua_pcall(L, 6, 0, error_handler));
257+
PCALL_RES(lua_pcall(L, 6, 1, error_handler));
258258

259259
bool retval = lua_toboolean(L, -1);
260260
lua_pop(L, 2); // Pop object and error handler

0 commit comments

Comments
 (0)
Please sign in to comment.