summaryrefslogtreecommitdiff
path: root/mining_drill.lua
diff options
context:
space:
mode:
authorMaciej Kasatkin <mk@realbadangel.pl>2012-10-28 20:03:36 +0100
committerMaciej Kasatkin <mk@realbadangel.pl>2012-10-28 20:03:36 +0100
commit01b21d49af04f9b3251c5edfb759995dc45d5110 (patch)
treeb40c70f82f929b8b1eb0cbb8d79dab4332542291 /mining_drill.lua
parent9d2979f365aad6963e814fa78b6f37d51d00043c (diff)
update
Diffstat (limited to 'mining_drill.lua')
-rw-r--r--mining_drill.lua9
1 files changed, 4 insertions, 5 deletions
diff --git a/mining_drill.lua b/mining_drill.lua
index 33dfe2b..5fc5377 100644
--- a/mining_drill.lua
+++ b/mining_drill.lua
@@ -7,14 +7,13 @@ minetest.register_tool("technic:mining_drill", {
on_use = function(itemstack, user, pointed_thing)
if pointed_thing.type=="node" then
item=itemstack:to_table()
- local charge=tonumber((item["wear"]))
- if charge ==0 then charge =65535 end
- charge=get_RE_item_load(charge,mining_drill_max_charge)
+ if item["metadata"]=="" or item["metadata"]=="0" then return end --tool not charged
+ charge=tonumber(item["metadata"])
if charge-200>0 then
drill_dig_it(minetest.get_pointed_thing_position(pointed_thing, above),user)
charge =charge-200;
- charge=set_RE_item_load(charge,mining_drill_max_charge)
- item["wear"]=tostring(charge)
+ item["metadata"]=tostring(charge)
+ set_RE_wear(item,charge,mining_drill_max_charge)
itemstack:replace(item)
end
return itemstack