From f93d1d476189c52b9535c034857fb6886d662755 Mon Sep 17 00:00:00 2001 From: Shtoyan Date: Fri, 21 Jan 2022 16:58:41 +0400 Subject: [PATCH] GetAmmoMulti Instigator accessed none fix --- sources/Weapons/NiceWeapon.uc | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/sources/Weapons/NiceWeapon.uc b/sources/Weapons/NiceWeapon.uc index 609c211..2587ba0 100644 --- a/sources/Weapons/NiceWeapon.uc +++ b/sources/Weapons/NiceWeapon.uc @@ -1578,6 +1578,30 @@ simulated function Destroyed(){ super(KFWeapon).Destroyed(); } + +simulated function float GetAmmoMulti() +{ + if (NextAmmoCheckTime > Level.TimeSeconds) + { + return LastAmmoResult; + } + + NextAmmoCheckTime = Level.TimeSeconds + 1; + + // Instigator accessed none fix + if (FireMode[0] != none && FireMode[0].AmmoClass != none && Instigator != none && KFPlayerReplicationInfo(Instigator.PlayerReplicationInfo) != none && + KFPlayerReplicationInfo(Instigator.PlayerReplicationInfo).ClientVeteranSkill != none ) + { + LastAmmoResult = KFPlayerReplicationInfo(Instigator.PlayerReplicationInfo).ClientVeteranSkill.static.AddExtraAmmoFor(KFPlayerReplicationInfo(Instigator.PlayerReplicationInfo), FireMode[0].AmmoClass); + } + else + { + LastAmmoResult = 1; + } + + return LastAmmoResult; +} + defaultproperties { recordedZoomTime=-1.000000