summaryrefslogtreecommitdiff
path: root/nodes/node_crate.lua
diff options
context:
space:
mode:
Diffstat (limited to 'nodes/node_crate.lua')
-rw-r--r--nodes/node_crate.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/nodes/node_crate.lua b/nodes/node_crate.lua
index 080fe68..101d7bb 100644
--- a/nodes/node_crate.lua
+++ b/nodes/node_crate.lua
@@ -2,6 +2,8 @@
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
+local modpath_awards = minetest.get_modpath("awards")
+
minetest.register_node("digtron:empty_crate", {
description = S("Digtron Crate (Empty)"),
_doc_items_longdesc = digtron.doc.empty_crate_longdesc,
@@ -34,6 +36,13 @@ minetest.register_node("digtron:empty_crate", {
local old_node = node_image.node
minetest.remove_node(old_pos)
+ if modpath_awards then
+ -- We're about to tell the awards mod that we're digging a node, but we
+ -- don't want it to count toward any actual awards. Pre-decrement.
+ local data = awards.players[clicker:get_player_name()]
+ awards.increment_item_counter(data, "count", old_node.name, -1)
+ end
+
for _, callback in ipairs(minetest.registered_on_dignodes) do
-- Copy pos and node because callback can modify them
local pos_copy = {x=old_pos.x, y=old_pos.y, z=old_pos.z}