Skip to content

Commit

Permalink
fix(server): DOES_PLAYER_EXIST with TempIDs
Browse files Browse the repository at this point in the history
After 50637e5, DOES_PLAYER_EXIST would
return true for TempIDs belonging to an already-connected player, which
would be a compatibility break.

Since the other fix (TempIDs being invalidated after connection, which
would've been intended behavior) was also a compatibility break, we'll
check for the NetID matching instead.
  • Loading branch information
blattersturm committed Aug 4, 2023
1 parent ef98b48 commit 70a6ee5
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -32,7 +32,9 @@ static void CreatePlayerCommands()

fx::ScriptEngine::RegisterNativeHandler("DOES_PLAYER_EXIST", MakeClientFunction([](fx::ScriptContext& context, const fx::ClientSharedPtr& client)
{
return true;
auto matchID = atoi(context.CheckArgument<const char*>(0));

return client->GetNetId() == matchID;
}));

fx::ScriptEngine::RegisterNativeHandler("GET_PLAYER_GUID", MakeClientFunction([](fx::ScriptContext& context, const fx::ClientSharedPtr& client)
Expand Down

0 comments on commit 70a6ee5

Please sign in to comment.