1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-17 18:35:20 +02:00

Allow nil puncher in object:punch (#14319)

This commit is contained in:
sfence
2024-04-28 17:55:04 +02:00
committed by GitHub
parent fc0ac64277
commit 72cb4e9bea
11 changed files with 89 additions and 36 deletions

View File

@@ -0,0 +1,11 @@
local message = function(msg)
minetest.log("action", "[callbacks] "..msg)
minetest.chat_send_all(msg)
end
core.register_on_punchplayer(function(player, hitter, time_from_last_punch, tool_capabilities, dir, damage)
if not hitter then
message("Player "..player:get_player_name().." punched without hitter.")
end
end)