From 8d7eebd39055dcf88c7d5d1098b747ed17de934f Mon Sep 17 00:00:00 2001 From: Sardelka9515 <106232474+Sardelka9515@users.noreply.github.com> Date: Sun, 3 Jul 2022 23:42:00 +0800 Subject: [PATCH] Fix DeleteEntity not being dispatched to main thread --- RageCoop.Client/Scripting/BaseScript.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RageCoop.Client/Scripting/BaseScript.cs b/RageCoop.Client/Scripting/BaseScript.cs index 53dd560..17d0088 100644 --- a/RageCoop.Client/Scripting/BaseScript.cs +++ b/RageCoop.Client/Scripting/BaseScript.cs @@ -65,7 +65,7 @@ namespace RageCoop.Client.Scripting private void SetEntity(CustomEventReceivedArgs obj) { - Main.QueueAction(() => + API.QueueAction(() => { var e=Entity.FromHandle((int)obj.Args[0]); e.Position = (Vector3)obj.Args[1]; @@ -75,7 +75,7 @@ namespace RageCoop.Client.Scripting private void DeleteEntity(CustomEventReceivedArgs e) { - Entity.FromHandle((int)e.Args[0]).Delete(); + API.QueueAction(() => Entity.FromHandle((int)e.Args[0])?.Delete()); } public override void OnStop()