added bugfix to train blacklisting

This commit is contained in:
Monica Moniot
2022-11-20 09:19:51 -05:00
parent 3a8e91b11d
commit 99201beee8
6 changed files with 23 additions and 8 deletions

1
TODO
View File

@@ -5,3 +5,4 @@ do hardcore testing
models & art models & art
space elevator compat space elevator compat
railloader compat railloader compat
major bug with copy-paste when the operation is changed by blueprint but it gets copied to the old settings before it's checked for update

View File

@@ -20,8 +20,13 @@ Date: 2022-11-13
Features: Features:
- Added warmup period on just built stations - Added warmup period on just built stations
--------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------
Version: 0.3.0 Version: 0.4.0
Date: 2022-11-15 Date: 2022-11-15
Features: Features:
- Fixed copy-paste - Fixed copy-paste
- Added alert sounds - Added alert sounds
---------------------------------------------------------------------------------------------------
Version: 0.4.1
Date: 2022-11-20
Features:
- Bugfix with train blacklisting

View File

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

View File

@@ -12,7 +12,7 @@ combinator_entity.radius_visualisation_specification = {
distance = 1.5, distance = 1.5,
} }
combinator_entity.active_energy_usage = "10KW" combinator_entity.active_energy_usage = "10KW"
combinator_entity.allow_copy_paste = true combinator_entity.allow_copy_paste = false

View File

@@ -419,9 +419,9 @@ function on_combinator_updated(map_data, comb, new_params)
local is_pr_state = floor(bits/2)%3 local is_pr_state = floor(bits/2)%3
station.is_p = is_pr_state == 0 or is_pr_state == 1 station.is_p = is_pr_state == 0 or is_pr_state == 1
station.is_r = is_pr_state == 0 or is_pr_state == 2 station.is_r = is_pr_state == 0 or is_pr_state == 2
local allow_all_trains = bits%2 == 1 local allows_all_trains = bits%2 == 1
if station.allow_all_trains ~= allow_all_trains then if station.allows_all_trains ~= allows_all_trains then
station.allow_all_trains = allow_all_trains station.allows_all_trains = allows_all_trains
update_station_if_auto(map_data, station) update_station_if_auto(map_data, station)
end end
end end
@@ -862,8 +862,8 @@ local function main()
flib_event.register({defines.events.on_pre_surface_deleted, defines.events.on_pre_surface_cleared}, on_surface_removed) flib_event.register({defines.events.on_pre_surface_deleted, defines.events.on_pre_surface_cleared}, on_surface_removed)
flib_event.register(defines.events.on_entity_settings_pasted, on_paste) --flib_event.register(defines.events.on_entity_settings_pasted, on_paste)
flib_event.register(defines.events.on_player_cursor_stack_changed, on_cursor_stack_changed) --flib_event.register(defines.events.on_player_cursor_stack_changed, on_cursor_stack_changed)
local nth_tick = math.ceil(60/mod_settings.tps); local nth_tick = math.ceil(60/mod_settings.tps);
flib_event.on_nth_tick(nth_tick, function() flib_event.on_nth_tick(nth_tick, function()

View File

@@ -40,6 +40,15 @@ local migrations_table = {
map_data.to_comb_params[id] = get_comb_params(comb) map_data.to_comb_params[id] = get_comb_params(comb)
end end
end, end,
["0.4.1"] = function()
---@type MapData
local map_data = global
map_data.tick_state = STATE_INIT
for id, station in pairs(map_data.stations) do
station.allows_all_trains = station.allow_all_trains or station.allows_all_trains
station.allow_all_trains = nil
end
end,
} }
---@param data ConfigurationChangedData ---@param data ConfigurationChangedData