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:
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)
|
Reference in New Issue
Block a user