from the TournamentWeapon class:
Code: Select all
function bool HandlePickupQuery( inventory Item )
{
local int OldAmmo;
local Pawn P;
if (Item.Class == Class)
{
if ( Weapon(item).bWeaponStay && (!Weapon(item).bHeldItem || Weapon(item).bTossedOut) )
return true;
P = Pawn(Owner);
if ( AmmoType != None )
{
OldAmmo = AmmoType.AmmoAmount;
if ( AmmoType.AddAmmo(Weapon(Item).PickupAmmoCount) && (OldAmmo == 0)
&& (P.Weapon.class != item.class) && !P.bNeverSwitchOnPickup )
WeaponSet(P);
}
P.ReceiveLocalizedMessage( class'PickupMessagePlus', 0, None, None, Self.Class );
Item.PlaySound(Item.PickupSound);
if (Level.Game.LocalLog != None)
Level.Game.LocalLog.LogPickup(Item, Pawn(Owner));
if (Level.Game.WorldLog != None)
Level.Game.WorldLog.LogPickup(Item, Pawn(Owner));
Item.SetRespawn();
return true;
}
if ( Inventory == None )
return false;
return Inventory.HandlePickupQuery(Item);
}