mirror of
https://github.com/Xevion/project-cybersyn.git
synced 2025-12-11 02:08:16 -06:00
improved SE compat
This commit is contained in:
1
TODO
1
TODO
@@ -1,5 +1,4 @@
|
|||||||
bugs:
|
bugs:
|
||||||
fix crash in submitted massively modded world
|
|
||||||
check for bugs in new player's submitted world
|
check for bugs in new player's submitted world
|
||||||
find se bug https://mods.factorio.com/mod/cybersyn/discussion/639d1ea26f00ecfa7b048da0
|
find se bug https://mods.factorio.com/mod/cybersyn/discussion/639d1ea26f00ecfa7b048da0
|
||||||
https://mods.factorio.com/mod/cybersyn/discussion/63a52e54be4341bccc0446f8
|
https://mods.factorio.com/mod/cybersyn/discussion/63a52e54be4341bccc0446f8
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ Date: 2022-12-23
|
|||||||
- Made several alerts persistent
|
- Made several alerts persistent
|
||||||
- Fixed bug with depot priority not working
|
- Fixed bug with depot priority not working
|
||||||
- Fixed a memory leak relating to train layouts
|
- Fixed a memory leak relating to train layouts
|
||||||
|
- Fixed a rare crash when building stations
|
||||||
|
- Slightly improved compat with SE thanks to a bugfix in 0.6.94
|
||||||
---------------------------------------------------------------------------------------------------
|
---------------------------------------------------------------------------------------------------
|
||||||
Version: 1.1.7
|
Version: 1.1.7
|
||||||
Date: 2022-12-17
|
Date: 2022-12-17
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
"dependencies": [
|
"dependencies": [
|
||||||
"base",
|
"base",
|
||||||
"flib >= 0.6.0",
|
"flib >= 0.6.0",
|
||||||
"? space-exploration >= 0.6.90",
|
"? space-exploration >= 0.6.94",
|
||||||
"? miniloader",
|
"? miniloader",
|
||||||
"? nullius",
|
"? nullius",
|
||||||
"? pypostprocessing"
|
"? pypostprocessing"
|
||||||
|
|||||||
@@ -21,7 +21,6 @@
|
|||||||
---@field public economy Economy
|
---@field public economy Economy
|
||||||
---@field public each_refuelers {[uint]: true}
|
---@field public each_refuelers {[uint]: true}
|
||||||
---@field public active_alerts {[uint]: {[1]: LuaTrain, [2]: int}}?
|
---@field public active_alerts {[uint]: {[1]: LuaTrain, [2]: int}}?
|
||||||
---@field public se_tele_old_id {[string]: uint}
|
|
||||||
|
|
||||||
---@class Station
|
---@class Station
|
||||||
---@field public entity_stop LuaEntity
|
---@field public entity_stop LuaEntity
|
||||||
@@ -150,9 +149,6 @@ function init_global()
|
|||||||
global.each_refuelers = {}
|
global.each_refuelers = {}
|
||||||
|
|
||||||
IS_SE_PRESENT = remote.interfaces["space-exploration"] ~= nil
|
IS_SE_PRESENT = remote.interfaces["space-exploration"] ~= nil
|
||||||
if IS_SE_PRESENT then
|
|
||||||
global.se_tele_old_id = {}
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
---@param v string
|
---@param v string
|
||||||
|
|||||||
@@ -695,7 +695,6 @@ local function setup_se_compat()
|
|||||||
if not train then return end
|
if not train then return end
|
||||||
--NOTE: IMPORTANT, until se_on_train_teleport_finished_event is called map_data.trains[old_id] will reference an invalid train entity; our events have either been set up to account for this or should be impossible to trigger until teleportation is finished
|
--NOTE: IMPORTANT, until se_on_train_teleport_finished_event is called map_data.trains[old_id] will reference an invalid train entity; our events have either been set up to account for this or should be impossible to trigger until teleportation is finished
|
||||||
train.se_is_being_teleported = true
|
train.se_is_being_teleported = true
|
||||||
map_data.se_tele_old_id[train_unique_identifier] = old_id
|
|
||||||
interface_raise_train_teleport_started(old_id)
|
interface_raise_train_teleport_started(old_id)
|
||||||
end)
|
end)
|
||||||
---@param event {}
|
---@param event {}
|
||||||
@@ -711,8 +710,7 @@ local function setup_se_compat()
|
|||||||
|
|
||||||
--NOTE: event.old_train_id_1 from this event is useless, it's for one of the many transient trains SE spawns while teleporting the old train, only se_on_train_teleport_started_event returns the correct old train id
|
--NOTE: event.old_train_id_1 from this event is useless, it's for one of the many transient trains SE spawns while teleporting the old train, only se_on_train_teleport_started_event returns the correct old train id
|
||||||
--NOTE: please SE dev if you read this fix the issue where se_on_train_teleport_finished_event is returning the wrong old train id
|
--NOTE: please SE dev if you read this fix the issue where se_on_train_teleport_finished_event is returning the wrong old train id
|
||||||
local old_id = map_data.se_tele_old_id[train_unique_identifier]
|
local old_id = event.old_train_id_1
|
||||||
map_data.se_tele_old_id[train_unique_identifier] = nil
|
|
||||||
local train = map_data.trains[old_id]
|
local train = map_data.trains[old_id]
|
||||||
if not train then return end
|
if not train then return end
|
||||||
|
|
||||||
|
|||||||
@@ -121,6 +121,7 @@ local migrations_table = {
|
|||||||
map_data.tick_data = {}
|
map_data.tick_data = {}
|
||||||
|
|
||||||
map_data.each_refuelers = {}
|
map_data.each_refuelers = {}
|
||||||
|
map_data.se_tele_old_id = nil
|
||||||
|
|
||||||
for k, comb in pairs(map_data.to_comb) do
|
for k, comb in pairs(map_data.to_comb) do
|
||||||
local control = get_comb_control(comb)
|
local control = get_comb_control(comb)
|
||||||
|
|||||||
Reference in New Issue
Block a user