Skip to content

Commit

Permalink
fix(server): error as rpc answer
Browse files Browse the repository at this point in the history
  • Loading branch information
Doxoh committed Feb 23, 2024
1 parent 9bc0d9a commit 2d72bf7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion api/AltV.Net.Async/AsyncCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -986,12 +986,14 @@ public override void OnScriptRPCEvent(IntPtr eventpointer, IPlayer target, strin

if (!ScriptRpcAsyncEventHandler.HasEvents()) return;

Task.Run(async () =>
var task = Task.Run(async () =>
{
var clientScriptRPCEvent = new AsyncScriptRpcEvent(target, answerId);
await ScriptRpcAsyncEventHandler.CallAsync(@delegate => @delegate(clientScriptRPCEvent, target, name, objects, answerId));
});

Task.WaitAll(task);

if (UnansweredServerRpcRequest.Contains(answerId))
{
target.EmitRPCAnswer(answerId, null, "Answer not handled");
Expand Down
2 changes: 1 addition & 1 deletion runtime
Submodule runtime updated 1 files
+8 −2 c-api/core.cpp

0 comments on commit 2d72bf7

Please sign in to comment.