From cc64a17642c3ff4d4c887d010db0ef45bc944c83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 25 Jan 2024 17:13:25 +0200 Subject: [PATCH] Skip intervals that are deleted within callbacks --- src/openrct2/scripting/ScriptEngine.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/openrct2/scripting/ScriptEngine.cpp b/src/openrct2/scripting/ScriptEngine.cpp index 2fef43b0b7..6211471bc5 100644 --- a/src/openrct2/scripting/ScriptEngine.cpp +++ b/src/openrct2/scripting/ScriptEngine.cpp @@ -1678,6 +1678,12 @@ void ScriptEngine::UpdateIntervals() continue; } + if (interval.Deleted) + { + // There is a chance that in one of the callbacks it deletes another interval. + continue; + } + ExecutePluginCall(interval.Owner, interval.Callback, {}, false); interval.LastTimestamp = timestamp;