summaryrefslogtreecommitdiff
path: root/util.lua
diff options
context:
space:
mode:
authorFaceDeer <derksenmobile@gmail.com>2017-10-10 20:33:56 -0600
committerFaceDeer <derksenmobile@gmail.com>2017-10-10 20:33:56 -0600
commit06a2ba85e3254e7d5ccb5ac2f4c56823d6a03854 (patch)
tree1975f6db5ce892446b8c4b68fe3f01487555e312 /util.lua
parentf10d46d3796d390e5ac5036c8bed93c69926c1c5 (diff)
various tidies and tweaks to technic support
Diffstat (limited to 'util.lua')
-rw-r--r--util.lua10
1 files changed, 2 insertions, 8 deletions
diff --git a/util.lua b/util.lua
index 8391dd1..07d41ba 100644
--- a/util.lua
+++ b/util.lua
@@ -226,11 +226,9 @@ digtron.tap_batteries = function(battery_positions, target, test)
end
for i, itemstack in pairs(invlist) do
-
local meta = minetest.deserialize(itemstack:get_metadata())
- if (meta =~ nil) then
+ if (meta ~= nil) then
local power_available = math.floor(meta.charge / digtron.config.power_ratio)
- minetest.chat_send_all("Charge reported: "..meta.charge.." which is enough for "..power_available.." power")
if power_available ~= 0 then
local actual_burned = power_available -- we just take all we have from the battery, since they aren't stackable
if test ~= true then
@@ -265,11 +263,7 @@ digtron.tap_batteries = function(battery_positions, target, test)
break
end
end
-
- if (current_burned == 0) then
- minetest.chat_send_all("Batteries not found!")
- end
-
+
if test ~= true then
-- only update the list if we're doing this for real.
inv:set_list("batteries", invlist)