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