Merge pull request #17 from mamoniot/main

1.1.7
This commit is contained in:
Monica Moniot
2022-12-22 18:11:57 -06:00
committed by GitHub
3 changed files with 30 additions and 15 deletions

View File

@@ -1,4 +1,9 @@
--------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------
Version: 1.1.7
Date: 2022-12-17
Changes:
- Fixed false positives in copy-paste by blueprint detection logic
---------------------------------------------------------------------------------------------------
Version: 1.1.6 Version: 1.1.6
Date: 2022-12-16 Date: 2022-12-16
Changes: Changes:

View File

@@ -1,6 +1,6 @@
{ {
"name": "cybersyn", "name": "cybersyn",
"version": "1.1.6", "version": "1.1.7",
"title": "Project Cybersyn", "title": "Project Cybersyn",
"author": "Mami", "author": "Mami",
"factorio_version": "1.1", "factorio_version": "1.1",

View File

@@ -398,24 +398,34 @@ function combinator_update(map_data, comb, reset_display)
local params = control.parameters local params = control.parameters
local old_params = map_data.to_comb_params[unit_number] local old_params = map_data.to_comb_params[unit_number]
local has_changed = false local has_changed = false
local station
local id
local stop = map_data.to_stop[comb.unit_number]
if reset_display and stop then if params.operation == MODE_PRIMARY_IO_ACTIVE or params.operation == MODE_PRIMARY_IO_FAILED_REQUEST or params.operation == MODE_PRIMARY_IO then
id = stop.unit_number --the follow is only present to fix combinators that have been copy-pasted by blueprint with the wrong operation
station = map_data.stations[id] local stop = map_data.to_stop[comb.unit_number--[[@as uint]]]
if station then local should_reset = reset_display
--make sure only MODE_PRIMARY_IO gets stored on map_data.to_comb_params if stop then
if station.display_state >= 2 then id = stop.unit_number--[[@as uint]]
params.operation = MODE_PRIMARY_IO_ACTIVE station = map_data.stations[id]
elseif station.display_state == 1 then if should_reset and station and station.entity_comb1 == comb then
params.operation = MODE_PRIMARY_IO_FAILED_REQUEST --make sure only MODE_PRIMARY_IO gets stored on map_data.to_comb_params
else if station.display_state >= 2 then
params.operation = MODE_PRIMARY_IO params.operation = MODE_PRIMARY_IO_ACTIVE
elseif station.display_state == 1 then
params.operation = MODE_PRIMARY_IO_FAILED_REQUEST
else
params.operation = MODE_PRIMARY_IO
end
control.parameters = params
should_reset = false
end end
end
if should_reset then
params.operation = MODE_PRIMARY_IO
control.parameters = params control.parameters = params
end end
end
if params.operation == MODE_PRIMARY_IO_ACTIVE or params.operation == MODE_PRIMARY_IO_FAILED_REQUEST then
params.operation = MODE_PRIMARY_IO params.operation = MODE_PRIMARY_IO
end end
if params.operation ~= old_params.operation then if params.operation ~= old_params.operation then