Skip to content

Commit

Permalink
Log usage of /pulverize (#7503)
Browse files Browse the repository at this point in the history
  • Loading branch information
ClobberXD authored and SmallJoker committed Jun 30, 2018
1 parent 222866b commit f3b7be9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions builtin/game/chatcommands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
Expand Down

0 comments on commit f3b7be9

Please sign in to comment.