Skip to content

Commit

Permalink
ignore-wires-on-depots
Browse files Browse the repository at this point in the history
  • Loading branch information
mrvn committed Apr 2, 2019
1 parent 61d737f commit ea8e25d
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions script/stop-update.lua
Expand Up @@ -204,28 +204,31 @@ function UpdateStop(stopID)
errors = 3
break
end
local stop_green = stop.entity.get_circuit_network(defines.wire_type.green)
if stop_green then
stop_green = stop_green.network_id
if green and green ~= stop_green then
-- if not depot then must be on the same circuit network
if not isDepot then
local stop_green = stop.entity.get_circuit_network(defines.wire_type.green)
if stop_green then
stop_green = stop_green.network_id
if green and green ~= stop_green then
errors = bit32.bor(errors, 1)
end
green = stop_green
elseif not isDepot then
errors = bit32.bor(errors, 1)
end
green = stop_green
elseif not isDepot then
errors = bit32.bor(errors, 1)
end
local stop_red = stop.entity.get_circuit_network(defines.wire_type.red)
if stop_red then
stop_red = stop_red.network_id
if red and red ~= stop_red then
local stop_red = stop.entity.get_circuit_network(defines.wire_type.red)
if stop_red then
stop_red = stop_red.network_id
if red and red ~= stop_red then
errors = bit32.bor(errors, 2)
end
red = stop_red
elseif not isDepot then
errors = bit32.bor(errors, 2)
end
red = stop_red
elseif not isDepot then
errors = bit32.bor(errors, 2)
end
if errors == 3 then
break
if errors == 3 then
break
end
end
end
if errors == 3 then
Expand Down

0 comments on commit ea8e25d

Please sign in to comment.