mirror of
https://github.com/Xevion/project-cybersyn.git
synced 2025-12-10 06:08:11 -06:00
fixed false positive bug
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
"__Profiler",
|
||||
"create_inactivity_order"
|
||||
],
|
||||
"Lua.workspace.checkThirdParty": false,
|
||||
"runtime": {
|
||||
"plugin": "C:\\Users\\mmoni\\files\\data\\projects\\factorio\\cybersyn\\.vscode\\lua\\plugin.lua",
|
||||
"pluginArgs": [
|
||||
@@ -35,4 +36,4 @@
|
||||
"useGitIgnore": false
|
||||
},
|
||||
"workspace.ignoreSubmodules": false
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
Date: 2022-12-16
|
||||
Changes:
|
||||
|
||||
@@ -398,24 +398,33 @@ function combinator_update(map_data, comb, reset_display)
|
||||
local params = control.parameters
|
||||
local old_params = map_data.to_comb_params[unit_number]
|
||||
local has_changed = false
|
||||
local station
|
||||
local id
|
||||
|
||||
local stop = map_data.to_stop[comb.unit_number]
|
||||
if reset_display and stop then
|
||||
id = stop.unit_number
|
||||
station = map_data.stations[id]
|
||||
if station then
|
||||
--make sure only MODE_PRIMARY_IO gets stored on map_data.to_comb_params
|
||||
if station.display_state >= 2 then
|
||||
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
|
||||
|
||||
if params.operation == MODE_PRIMARY_IO_ACTIVE or params.operation == MODE_PRIMARY_IO_FAILED_REQUEST or params.operation == MODE_PRIMARY_IO then
|
||||
--the follow is only present to fix combinators that have been copy-pasted by blueprint with the wrong operation
|
||||
local stop = map_data.to_stop[comb.unit_number--[[@as uint]]]
|
||||
if stop then
|
||||
id = stop.unit_number--[[@as uint]]
|
||||
station = map_data.stations[id]
|
||||
if reset_display then
|
||||
if station and station.entity_comb1 == comb then
|
||||
--make sure only MODE_PRIMARY_IO gets stored on map_data.to_comb_params
|
||||
if station.display_state >= 2 then
|
||||
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
|
||||
else
|
||||
params.operation = MODE_PRIMARY_IO
|
||||
control.parameters = params
|
||||
end
|
||||
end
|
||||
control.parameters = params
|
||||
end
|
||||
end
|
||||
if params.operation == MODE_PRIMARY_IO_ACTIVE or params.operation == MODE_PRIMARY_IO_FAILED_REQUEST then
|
||||
params.operation = MODE_PRIMARY_IO
|
||||
end
|
||||
if params.operation ~= old_params.operation then
|
||||
|
||||
Reference in New Issue
Block a user