From a93030e61051a65793050a9c2be3fbd3cc3bcea4 Mon Sep 17 00:00:00 2001 From: enteryournamehere <11255568+enteryournamehere@users.noreply.github.com> Date: Mon, 28 Aug 2023 15:57:02 +0200 Subject: [PATCH] Also fix updating of struct in another place --- .../Components/ReplicaComponents/RacingControlComponent.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Uchu.World/Objects/Components/ReplicaComponents/RacingControlComponent.cs b/Uchu.World/Objects/Components/ReplicaComponents/RacingControlComponent.cs index d600086d..d851a70a 100644 --- a/Uchu.World/Objects/Components/ReplicaComponents/RacingControlComponent.cs +++ b/Uchu.World/Objects/Components/ReplicaComponents/RacingControlComponent.cs @@ -230,9 +230,11 @@ private async Task OnPlayerLoad(Player player) RacingPlayerInfo playerInfo; if (IsPlayerRegistered(player)) { - playerInfo = Players.Find(info => info.Player.Id == player.Id); + var playerInfoIndex = Players.FindIndex(info => info.Player.Id == player.Id); + playerInfo = Players[playerInfoIndex]; playerInfo.Player = player; playerInfo.PlayerLoaded = true; + Players[playerInfoIndex] = playerInfo; } else { playerInfo = new RacingPlayerInfo {