aboutsummaryrefslogtreecommitdiff
path: root/builtin/game
diff options
context:
space:
mode:
authorAnand S <ClobberXD@gmail.com>2018-06-30 16:23:43 +0530
committerSmallJoker <SmallJoker@users.noreply.github.com>2018-06-30 12:53:43 +0200
commitf3b7be97feb5f1de8f31c1841cb7fdd3d89ac451 (patch)
tree9d9b3f5defe7620c4b5d6c367e54627b9da463d8 /builtin/game
parent222866bab7e1b22245840fd2130122d2709b1cab (diff)
downloadminetest-f3b7be97feb5f1de8f31c1841cb7fdd3d89ac451.tar.gz
minetest-f3b7be97feb5f1de8f31c1841cb7fdd3d89ac451.tar.bz2
minetest-f3b7be97feb5f1de8f31c1841cb7fdd3d89ac451.zip
Log usage of /pulverize (#7503)
Diffstat (limited to 'builtin/game')
-rw-r--r--builtin/game/chatcommands.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/builtin/game/chatcommands.lua b/builtin/game/chatcommands.lua
index a8aaba9c6..d56f2112b 100644
--- a/builtin/game/chatcommands.lua
+++ b/builtin/game/chatcommands.lua
@@ -683,10 +683,13 @@ core.register_chatcommand("pulverize", {
core.log("error", "Unable to pulverize, no player.")
return false, "Unable to pulverize, no player."
end
- if player:get_wielded_item():is_empty() then
+ local wielded_item = player:get_wielded_item()
+ if wielded_item:is_empty() then
return false, "Unable to pulverize, no item in hand."
end
- player:set_wielded_item(nil)
+ core.log("action", name .. " pulverized \"" ..
+ wielded_item:get_name() .. " " .. wielded_item:get_count() .. "\"")
+ player:set_wielded_item(nil)
return true, "An item was pulverized."
end,
})