fix: Accessed None 'CurrentPerk' (ExtPlayerController:CheckPerk)

ScriptWarning: Accessed None 'CurrentPerk'
011ExtPlayerController KF-Crazy_Playboy_Edited.TheWorld:PersistentLevel.ExtPlayerController_1
011Function ServerExt.ExtPlayerController:CheckPerk:00B3
This commit is contained in:
GenZmeY 2022-07-12 17:43:51 +03:00
parent bec774b38c
commit d804cdc3bd

View File

@ -91,13 +91,16 @@ simulated function Destroyed()
function CheckPerk() function CheckPerk()
{ {
if (CurrentPerk!=ActivePerkManager) if (CurrentPerk != ActivePerkManager)
{ {
CurrentPerk = ActivePerkManager; CurrentPerk = ActivePerkManager;
if (KFPlayerReplicationInfo(PlayerReplicationInfo)!=None) if (KFPlayerReplicationInfo(PlayerReplicationInfo)!=None)
{ {
KFPlayerReplicationInfo(PlayerReplicationInfo).NetPerkIndex = 0; KFPlayerReplicationInfo(PlayerReplicationInfo).NetPerkIndex = 0;
KFPlayerReplicationInfo(PlayerReplicationInfo).CurrentPerkClass = ActivePerkManager.CurrentPerk.BasePerk; if (ActivePerkManager.CurrentPerk != None)
{
KFPlayerReplicationInfo(PlayerReplicationInfo).CurrentPerkClass = ActivePerkManager.CurrentPerk.BasePerk;
}
} }
} }
} }