summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFaceDeer <derksenmobile@gmail.com>2017-01-22 01:41:48 -0700
committerFaceDeer <derksenmobile@gmail.com>2017-01-22 01:41:48 -0700
commitb8f9a54d94ddc17a824fd323bbda7f074180c618 (patch)
tree631821e8312d95e6cffe938b7a9f11ba8c6c8aac
parent2d41c9ade114c961ce8910fdc585eec79d136025 (diff)
remove some redundant awards.tbv calls, add defaults
-rw-r--r--awards.lua16
1 files changed, 5 insertions, 11 deletions
diff --git a/awards.lua b/awards.lua
index 283a9a6..6a76371 100644
--- a/awards.lua
+++ b/awards.lua
@@ -13,23 +13,21 @@ digtron.award_item_dug = function (items_dropped, player)
end
local data = awards.players[player]
+
+ awards.tbv(data, "digtron_dug_groups")
+ awards.tbv(data["digtron_dug_groups"], "tree", 0)
+ awards.tbv(data["digtron_dug_groups"], "dirt", 0)
+ awards.tbv(data["digtron_dug_groups"], "grass", 0)
for _, item in pairs(items_dropped) do
awards.increment_item_counter(data, "digtron_dug", item)
-
if minetest.get_item_group(item, "tree") > 0 then
- awards.tbv(data, "digtron_dug_groups")
- awards.tbv(data["digtron_dug_groups"], "tree")
data["digtron_dug_groups"]["tree"] = data["digtron_dug_groups"]["tree"] + 1
end
if minetest.get_item_group(item, "dirt") > 0 then
- awards.tbv(data, "digtron_dug_groups")
- awards.tbv(data["digtron_dug_groups"], "dirt")
data["digtron_dug_groups"]["dirt"] = data["digtron_dug_groups"]["dirt"] + 1
end
if minetest.get_item_group(item, "grass") > 0 then
- awards.tbv(data, "digtron_dug_groups")
- awards.tbv(data["digtron_dug_groups"], "grass")
data["digtron_dug_groups"]["grass"] = data["digtron_dug_groups"]["grass"] + 1
end
end
@@ -70,10 +68,6 @@ digtron.award_item_dug = function (items_dropped, player)
end
end
- awards.tbv(data, "digtron_dug_groups")
- awards.tbv(data.digtron_dug_groups, "tree", 0)
- awards.tbv(data.digtron_dug_groups, "dirt", 0)
- awards.tbv(data.digtron_dug_groups, "grass", 0)
if data["digtron_dug_groups"]["tree"] > 1000 then
awards.unlock(player, "digtron_1000wood_dug")
if data["digtron_dug_groups"]["tree"] > 10000 then