mirror of
https://github.com/minetest-mods/technic.git
synced 2024-08-20 21:44:14 +02:00
Make batteries only charge/discharge from the bottom
(they were already supposed to but would leech charge from sideways neighbors too)
This commit is contained in:
parent
14e0c4c48c
commit
33455328bd
@ -133,7 +133,14 @@ function technic.register_battery_box(data)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local run = function(pos, node)
|
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)
|
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 eu_input = meta:get_int(tier.."_EU_input")
|
||||||
local current_charge = meta:get_int("internal_EU_charge")
|
local current_charge = meta:get_int("internal_EU_charge")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user