From: Anand S Date: Sat, 30 Jun 2018 10:53:43 +0000 (+0530) Subject: Log usage of /pulverize (#7503) X-Git-Tag: 5.0.0~324 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f3b7be97feb5f1de8f31c1841cb7fdd3d89ac451;p=oweals%2Fminetest.git Log usage of /pulverize (#7503) --- 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, })