summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-04-12 20:21:20 -0400
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-04-12 20:21:20 -0400
commit33455328bd4fbfacd26e3f02b77f2b54bea982d9 (patch)
tree0aa0cc3cf6b17c0e232360bcd4e63a3784645df6
parent14e0c4c48cbae3d9e53b36133265d8c1be6f8d07 (diff)
Make batteries only charge/discharge from the bottom
(they were already supposed to but would leech charge from sideways neighbors too)
-rw-r--r--technic/machines/register/battery_box.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/technic/machines/register/battery_box.lua b/technic/machines/register/battery_box.lua
index bb9c29d..7f7f38e 100644
--- a/technic/machines/register/battery_box.lua
+++ b/technic/machines/register/battery_box.lua
@@ -133,7 +133,14 @@ function technic.register_battery_box(data)
end
local run = function(pos, node)
+ local below = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z})
local meta = minetest.get_meta(pos)
+
+ if below.name ~= "technic:"..ltier.."_cable" then
+ meta:set_string("infotext", S("%s Battery Box Has No Network"):format(tier))
+ return
+ end
+
local eu_input = meta:get_int(tier.."_EU_input")
local current_charge = meta:get_int("internal_EU_charge")