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.
This commit is contained in:
Anton Tarasenko 2020-02-19 00:48:48 +07:00
parent dc6a28224a
commit c2942b6323

View File

@ -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)