Skip to content

Commit

Permalink
only disconnect neigh if damage_type is nil #20
Browse files Browse the repository at this point in the history
  • Loading branch information
remijouannet committed Nov 18, 2022
1 parent fb0b352 commit 073c126
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#factorio/bin/x64/factorio --graphics-quality low --video-memory-usage low --load-game factoriofast/saves/_autosave2.zip --threads 4
#/Applications/Factorio.app/Contents/MacOS/factorio --graphics-quality low --video-memory-usage low --threads 4

VERSION=$$(git describe --abbrev=0 --tags)

Expand Down
4 changes: 2 additions & 2 deletions power.lua
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ function on_power_destroy(event)
local networks = script_data.networks
local current_idx = entity.electric_network_id
-- Make sure to create the new network ids before collecting new info
if entity.neighbours.copper then
entity.disconnect_neighbour()
if entity.neighbours.copper and event.damage_type == nil then
entity.disconnect_neighbour()
end
local finds = surface.find_entities_filtered({type = "electric-pole", area = area})
for _, new_entity in pairs(finds) do
Expand Down

0 comments on commit 073c126

Please sign in to comment.