rotor distance reduced
power distribution bugfix powerswitch bugfix
This commit is contained in:
parent
a9151bfd3e
commit
821e80fe88
@ -363,7 +363,7 @@ local function trigger_nodes(mst_pos, mst_mem, dec)
|
|||||||
mem.pwr_node_alive_cnt = (mem.pwr_node_alive_cnt or 1) - dec
|
mem.pwr_node_alive_cnt = (mem.pwr_node_alive_cnt or 1) - dec
|
||||||
mem.pwr_power_provided_cnt = 2
|
mem.pwr_power_provided_cnt = 2
|
||||||
if D.pwr then D.dbg("trigger_nodes", minetest.get_node(pos).name, mem.pwr_node_alive_cnt, mem.pwr_available2 or mem.pwr_available or mem.pwr_needed) end
|
if D.pwr then D.dbg("trigger_nodes", minetest.get_node(pos).name, mem.pwr_node_alive_cnt, mem.pwr_available2 or mem.pwr_available or mem.pwr_needed) end
|
||||||
if mem.pwr_node_alive_cnt >= 0 then
|
if mem.pwr_node_alive_cnt >= 0 or mem.pwr_state == NOPOWER then
|
||||||
if mem.pwr_available then
|
if mem.pwr_available then
|
||||||
handle_generator(mst_mem, mem, pos, mem.pwr_available)
|
handle_generator(mst_mem, mem, pos, mem.pwr_available)
|
||||||
elseif mem.pwr_needed then
|
elseif mem.pwr_needed then
|
||||||
|
@ -266,16 +266,16 @@ techage.register_node({"techage:powerswitch", "techage:powerswitch_on"}, {
|
|||||||
on_recv_message = function(pos, src, topic, payload)
|
on_recv_message = function(pos, src, topic, payload)
|
||||||
local node = minetest.get_node(pos)
|
local node = minetest.get_node(pos)
|
||||||
if topic == "on" and node.name == "techage:powerswitch" then
|
if topic == "on" and node.name == "techage:powerswitch" then
|
||||||
switch_on(pos, node, "techage:powerswitch_on")
|
switch_on(pos, node, nil, "techage:powerswitch_on")
|
||||||
return true
|
return true
|
||||||
elseif topic == "on" and node.name == "techage:powerswitchsmall" then
|
elseif topic == "on" and node.name == "techage:powerswitchsmall" then
|
||||||
switch_on(pos, node, "techage:powerswitchsmall_on")
|
switch_on(pos, node, nil, "techage:powerswitchsmall_on")
|
||||||
return true
|
return true
|
||||||
elseif topic == "off" and node.name == "techage:powerswitch_on" then
|
elseif topic == "off" and node.name == "techage:powerswitch_on" then
|
||||||
switch_off(pos, node, "techage:powerswitch")
|
switch_off(pos, node, nil, "techage:powerswitch")
|
||||||
return true
|
return true
|
||||||
elseif topic == "off" and node.name == "techage:powerswitchsmall_on" then
|
elseif topic == "off" and node.name == "techage:powerswitchsmall_on" then
|
||||||
switch_off(pos, node, "techage:powerswitchsmall")
|
switch_off(pos, node, nil, "techage:powerswitchsmall")
|
||||||
return true
|
return true
|
||||||
elseif topic == "state" then
|
elseif topic == "state" then
|
||||||
if node.name == "techage:powerswitch_on" or node.name == "techage:powerswitchsmall_on"then
|
if node.name == "techage:powerswitch_on" or node.name == "techage:powerswitchsmall_on"then
|
||||||
|
@ -52,8 +52,8 @@ local function add_rotor(pos, mem, player_name)
|
|||||||
mem.error = false
|
mem.error = false
|
||||||
|
|
||||||
-- Check for next wind turbine
|
-- Check for next wind turbine
|
||||||
local pos1 = {x=pos.x-14, y=pos.y-9, z=pos.z-14}
|
local pos1 = {x=pos.x-13, y=pos.y-9, z=pos.z-13}
|
||||||
local pos2 = {x=pos.x+14, y=pos.y+10, z=pos.z+14}
|
local pos2 = {x=pos.x+13, y=pos.y+10, z=pos.z+13}
|
||||||
local num = #minetest.find_nodes_in_area(pos1, pos2, {"techage:ta4_wind_turbine"})
|
local num = #minetest.find_nodes_in_area(pos1, pos2, {"techage:ta4_wind_turbine"})
|
||||||
if num > 1 then
|
if num > 1 then
|
||||||
if player_name then
|
if player_name then
|
||||||
|
Loading…
Reference in New Issue
Block a user