mirror of
https://github.com/Xevion/project-cybersyn.git
synced 2025-12-13 02:12:37 -06:00
attempted fix
This commit is contained in:
@@ -98,8 +98,8 @@
|
||||
---@alias cybersyn.global MapData
|
||||
---@type CybersynModSettings
|
||||
mod_settings = {}
|
||||
|
||||
IS_SE_PRESENT = remote.interfaces["space-exploration"] ~= nil
|
||||
---@type boolean
|
||||
IS_SE_PRESENT = nil
|
||||
|
||||
function init_global()
|
||||
global.total_ticks = 0
|
||||
@@ -124,6 +124,7 @@ function init_global()
|
||||
global.layout_train_count = {}
|
||||
global.layout_top_id = 1
|
||||
|
||||
IS_SE_PRESENT = remote.interfaces["space-exploration"] ~= nil
|
||||
if IS_SE_PRESENT then
|
||||
global.se_tele_old_id = {}
|
||||
end
|
||||
|
||||
@@ -1017,12 +1017,14 @@ local function main()
|
||||
script.on_configuration_changed(on_config_changed)
|
||||
|
||||
|
||||
if IS_SE_PRESENT then
|
||||
script.on_load(function()
|
||||
IS_SE_PRESENT = remote.interfaces["space-exploration"] ~= nil
|
||||
if not IS_SE_PRESENT then return end
|
||||
|
||||
local se_on_train_teleport_finished_event = remote.call("space-exploration", "get_on_train_teleport_finished_event")
|
||||
local se_on_train_teleport_started_event = remote.call("space-exploration", "get_on_train_teleport_started_event")
|
||||
|
||||
|
||||
---@param event {}
|
||||
script.on_event(se_on_train_teleport_started_event, function(event)
|
||||
---@type MapData
|
||||
local map_data = global
|
||||
@@ -1038,6 +1040,7 @@ local function main()
|
||||
map_data.se_tele_old_id[train_unique_identifier] = old_id
|
||||
interface_raise_train_teleport_started(old_id)
|
||||
end)
|
||||
---@param event {}
|
||||
script.on_event(se_on_train_teleport_finished_event, function(event)
|
||||
---@type MapData
|
||||
local map_data = global
|
||||
@@ -1106,7 +1109,6 @@ local function main()
|
||||
end)
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user