Add check for periodic scripts changing the interface

This commit is contained in:
Alfredo Cardigliano 2023-07-13 16:14:10 +02:00
parent 55df85e4e0
commit 2ff83bcdc3
4 changed files with 14 additions and 6 deletions

View file

@ -2321,6 +2321,12 @@ local function runSystemChecks(granularity, checks_var, do_trace)
entity_info = info,
ts_enabled = checks_var.system_ts_enabled
})
-- Safety check
if interface.getId() ~= tonumber(getSystemInterfaceId()) then
traceError(TRACE_ERROR, TRACE_CONSOLE, string.format("Script '%s' changed the interface from '%d' to '%d'. Resetting interface.", mod_key, tonumber(getSystemInterfaceId()), interface.getId()))
interface.select(getSystemInterfaceId())
end
end
end
end