From fd1272952897827434f1c9ed4bd84d1eeb330e28 Mon Sep 17 00:00:00 2001 From: GenZmeY Date: Tue, 12 Jul 2022 17:56:05 +0300 Subject: [PATCH] fix: Accessed None 'BestN' (Ext_T_GhostHelper:CanResPlayer) ScriptWarning: Accessed None 'BestN' 011Ext_T_GhostHelper KF-KillingPool.TheWorld:PersistentLevel.Ext_T_GhostHelper_2 011Function ServerExt.Ext_T_GhostHelper:CanResPlayer:014C --- ServerExt/Classes/Ext_T_GhostHelper.uc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/ServerExt/Classes/Ext_T_GhostHelper.uc b/ServerExt/Classes/Ext_T_GhostHelper.uc index 158248c..80b34ae 100644 --- a/ServerExt/Classes/Ext_T_GhostHelper.uc +++ b/ServerExt/Classes/Ext_T_GhostHelper.uc @@ -8,6 +8,8 @@ var bool bTeleporting,bIsDelayed; function bool CanResPlayer(KFPawn_Human Other, byte Level) { + local Actor SpawnPoint; + if (bTeleporting) { if (LastDied!=None) @@ -23,11 +25,17 @@ function bool CanResPlayer(KFPawn_Human Other, byte Level) else if (Level==1 && Rand(2)==0) return false; - LastDied = Other; - bTeleporting = true; if (SpawnPointer==None) SpawnPointer = class'ExtSpawnPointHelper'.Static.FindHelper(WorldInfo); - ResPoint = SpawnPointer.PickBestSpawn().Location; + + SpawnPoint = SpawnPointer.PickBestSpawn(); + if (SpawnPoint == None) + return false; + + LastDied = Other; + bTeleporting = true; + + ResPoint = SpawnPoint.Location; LastDied.FindSpot(vect(36,36,86),ResPoint); if (VSizeSq(LastDied.Location-ResPoint)<1.f) // Prevent division by zero errors in future. ResPoint.Z+=5;