From 311e0f278db177facc12b81c4c93ea518f84adc9 Mon Sep 17 00:00:00 2001 From: Goldiedtv Date: Sat, 4 Oct 2025 18:36:19 +0300 Subject: [PATCH] [GTASA] Wrapped update-function in try-catch to fix crashing on Linux --- GTASA.asl | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/GTASA.asl b/GTASA.asl index 7900486..4a7b809 100644 --- a/GTASA.asl +++ b/GTASA.asl @@ -987,28 +987,35 @@ init update { - //============================================================================= - // General Housekeeping - //============================================================================= - // Disable all timer control actions if version was not detected - if (!vars.enabled) - return false; + try + { + //============================================================================= + // General Housekeeping + //============================================================================= + // Disable all timer control actions if version was not detected + if (!vars.enabled) + return false; - // Update always, to prevent splitting after loading (if possible, doesn't seem to be 100% reliable) - vars.watchers.UpdateAll(game); + // Update always, to prevent splitting after loading (if possible, doesn't seem to be 100% reliable) + vars.watchers.UpdateAll(game); - // Clear list of already executed splits if timer is reset - if (timer.CurrentPhase != vars.PrevPhase) - { - if (timer.CurrentPhase == TimerPhase.NotRunning) + // Clear list of already executed splits if timer is reset + if (timer.CurrentPhase != vars.PrevPhase) { - vars.split.Clear(); - vars.DebugOutput("Cleared list of already executed splits"); + if (timer.CurrentPhase == TimerPhase.NotRunning) + { + vars.split.Clear(); + vars.DebugOutput("Cleared list of already executed splits"); + } + vars.PrevPhase = timer.CurrentPhase; } - vars.PrevPhase = timer.CurrentPhase; - } - //print(vars.watchers["pedStatus"].Current.ToString()); + //print(vars.watchers["pedStatus"].Current.ToString()); + } + catch + { + return false; + } } split