mirror of
https://github.com/luanti-org/luanti.git
synced 2025-09-15 18:57:08 +00:00
Allow nil
puncher in object:punch
(#14319)
This commit is contained in:
parent
fc0ac64277
commit
72cb4e9bea
11 changed files with 89 additions and 36 deletions
11
games/devtest/mods/callbacks/players.lua
Normal file
11
games/devtest/mods/callbacks/players.lua
Normal 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)
|
Loading…
Add table
Add a link
Reference in a new issue