From becb9201291bae6e845ace0c94f316c74766ab30 Mon Sep 17 00:00:00 2001 From: teascade Date: Sat, 8 Aug 2020 08:38:37 +0300 Subject: [PATCH] Make a safe-check for HandleUpdatePlayer and HandleSyncPckt --- Assets/Scripts/Networking/Instances/Client.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/Networking/Instances/Client.cs b/Assets/Scripts/Networking/Instances/Client.cs index 9308f8a..b23994e 100644 --- a/Assets/Scripts/Networking/Instances/Client.cs +++ b/Assets/Scripts/Networking/Instances/Client.cs @@ -131,14 +131,14 @@ namespace NeonTea.Quakeball.Networking.Instances { } private void HandleUpdatePlayer(PlayerUpdatePckt pckt) { - if (pckt.PlayerId == LocalPlayer.Id) { + if (pckt.PlayerId == LocalPlayer.Id && Players[pckt.PlayerId] != null) { return; // Ignore, again. } Players[pckt.PlayerId].Controlled.ProcessUpdatePacket(pckt); } private void HandleSyncPckt(PlayerSyncPacket syncPckt) { - if (syncPckt.Unsynced || syncPckt.PlayerId != LocalPlayer.Id) { + if (Players[syncPckt.PlayerId] != null && (syncPckt.Unsynced || syncPckt.PlayerId != LocalPlayer.Id)) { Players[syncPckt.PlayerId].Controlled.ProcessSyncPacket(syncPckt); } }