From c2942b632356d0e3ca03ec6d0753c2de94ccf88e Mon Sep 17 00:00:00 2001 From: Anton Tarasenko Date: Wed, 19 Feb 2020 00:48:48 +0700 Subject: [PATCH] Refactor to simplify `CheckAmmoPickup` effectively only contained another function call and itself was only called once. As it also didn't add to readbility, it needed to be removed. --- .../FixAmmoSelling/MutatorListener_FixAmmoSelling.uc | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/sources/Features/FixAmmoSelling/MutatorListener_FixAmmoSelling.uc b/sources/Features/FixAmmoSelling/MutatorListener_FixAmmoSelling.uc index f0e2b41..78178de 100644 --- a/sources/Features/FixAmmoSelling/MutatorListener_FixAmmoSelling.uc +++ b/sources/Features/FixAmmoSelling/MutatorListener_FixAmmoSelling.uc @@ -33,7 +33,8 @@ static function bool CheckReplacement(Actor other, out byte isSuperRelevant) return false; } CheckAbusableWeapon(KFWeapon(other)); - CheckAmmoPickup(KFAmmoPickup(other)); + // If it's ammo pickup - we need to stalk it + class'AmmoPickupStalker'.static.StalkAmmoPickup(KFAmmoPickup(other)); return true; } @@ -46,12 +47,6 @@ private static function CheckAbusableWeapon(KFWeapon newWeapon) ammoSellingFix.FixWeapon(newWeapon); } -private static final function CheckAmmoPickup(KFAmmoPickup newAmmoPickup) -{ - if (newAmmoPickup == none) return; - class'AmmoPickupStalker'.static.StalkAmmoPickup(newAmmoPickup); -} - // This function recreates the logic of 'KFWeapon.DropFrom()', // since standard 'ReplaceWith' function produces bad results. private static function ReplacePickupWith(Pickup oldPickup)