mirror of
https://github.com/minetest-mods/technic.git
synced 2025-07-07 02:30:36 +02:00
Batteries: Workaround to fix discharge (#609)
The network traversal code does still not handle connecting sides, but at least finite power is no more.
This commit is contained in:
@ -192,10 +192,10 @@ 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)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local network_id = tonumber(meta:get_string(tier.."_network"), 16)
|
||||
|
||||
if not technic.is_tier_cable(below.name, tier) then
|
||||
if not technic.networks[network_id] then
|
||||
meta:set_string("infotext", S("%s Battery Box Has No Network"):format(tier))
|
||||
return
|
||||
end
|
||||
|
@ -69,7 +69,7 @@ local function clear_networks(pos)
|
||||
elseif technic.machines[tier][node.name] then
|
||||
-- Found a machine
|
||||
local eu_type = technic.machines[tier][node.name]
|
||||
meta:set_string(tier.."_network", minetest.pos_to_string(sw_pos))
|
||||
meta:set_string(tier.."_network", string.format("%X", network_id))
|
||||
if eu_type == technic.producer then
|
||||
table.insert(network.PR_nodes, pos)
|
||||
elseif eu_type == technic.receiver then
|
||||
|
Reference in New Issue
Block a user