Skip to content

Commit ec521b6

Browse files
authored
Update EntityTreeViewModel.cs to skip duplicate player identities (#624)
Skip adding to the players view model dictionary if it already contains that key, no idea if this will build
1 parent 637b243 commit ec521b6

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎Torch.Server/ViewModels/EntityTreeViewModel.cs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ private void RegisterLiveNonEntities(ITorchSession session, TorchSessionState ne
103103
if (identity.SteamId == 0) continue;
104104
var player = MySession.Static.Players.TryGetPlayerIdentity(identity.SteamId);
105105
if (player is null) continue;
106+
if (Players.ContainsKey(player.IdentityId)) continue;
107+
106108
Players.Add(new KeyValuePair<long, PlayerViewModel>(player.IdentityId, new PlayerViewModel(player, identity)));
107109
}
108110

0 commit comments

Comments
 (0)