Fix DeleteEntity not being dispatched to main thread

This commit is contained in:
Sardelka9515 2022-07-03 23:42:00 +08:00 committed by GitHub
parent 0a5bb67c54
commit 8d7eebd390
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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()