Skip to content

Commit f3b7be9

Browse files
ClobberXDSmallJoker
authored andcommittedJun 30, 2018
Log usage of /pulverize (#7503)
1 parent 222866b commit f3b7be9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed
 

‎builtin/game/chatcommands.lua

+5-2
Original file line numberDiff line numberDiff line change
@@ -683,10 +683,13 @@ core.register_chatcommand("pulverize", {
683683
core.log("error", "Unable to pulverize, no player.")
684684
return false, "Unable to pulverize, no player."
685685
end
686-
if player:get_wielded_item():is_empty() then
686+
local wielded_item = player:get_wielded_item()
687+
if wielded_item:is_empty() then
687688
return false, "Unable to pulverize, no item in hand."
688689
end
689-
player:set_wielded_item(nil)
690+
core.log("action", name .. " pulverized \"" ..
691+
wielded_item:get_name() .. " " .. wielded_item:get_count() .. "\"")
692+
player:set_wielded_item(nil)
690693
return true, "An item was pulverized."
691694
end,
692695
})

0 commit comments

Comments
 (0)
Please sign in to comment.