mirror of
https://github.com/minetest-mods/digtron.git
synced 2024-12-23 04:42:23 +01:00
remove some redundant awards.tbv calls, add defaults
This commit is contained in:
parent
2d41c9ade1
commit
b8f9a54d94
16
awards.lua
16
awards.lua
@ -14,22 +14,20 @@ digtron.award_item_dug = function (items_dropped, player)
|
|||||||
|
|
||||||
local data = awards.players[player]
|
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
|
for _, item in pairs(items_dropped) do
|
||||||
awards.increment_item_counter(data, "digtron_dug", item)
|
awards.increment_item_counter(data, "digtron_dug", item)
|
||||||
|
|
||||||
if minetest.get_item_group(item, "tree") > 0 then
|
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
|
data["digtron_dug_groups"]["tree"] = data["digtron_dug_groups"]["tree"] + 1
|
||||||
end
|
end
|
||||||
if minetest.get_item_group(item, "dirt") > 0 then
|
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
|
data["digtron_dug_groups"]["dirt"] = data["digtron_dug_groups"]["dirt"] + 1
|
||||||
end
|
end
|
||||||
if minetest.get_item_group(item, "grass") > 0 then
|
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
|
data["digtron_dug_groups"]["grass"] = data["digtron_dug_groups"]["grass"] + 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -70,10 +68,6 @@ digtron.award_item_dug = function (items_dropped, player)
|
|||||||
end
|
end
|
||||||
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
|
if data["digtron_dug_groups"]["tree"] > 1000 then
|
||||||
awards.unlock(player, "digtron_1000wood_dug")
|
awards.unlock(player, "digtron_1000wood_dug")
|
||||||
if data["digtron_dug_groups"]["tree"] > 10000 then
|
if data["digtron_dug_groups"]["tree"] > 10000 then
|
||||||
|
Loading…
Reference in New Issue
Block a user