Advertisement
Guest User

DenyPickupWeaponTwice

a guest
Oct 26th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class DenyPickupWeaponTwice extends Mutator;
  2.  
  3. function bool HandlePickupQuery(Pawn Other, Inventory item, out byte bAllowPickup) {
  4.     Local Weapon weap;
  5.     if (item.isA('Weapon')) {      
  6.         weap = Weapon(Other.FindInventoryType(item.Class));
  7.         if (weap != None) {
  8.             if (!item.isA('WarHeadLauncher') || (weap.AmmoType != None &&
  9.                 weap.AmmoType.AmmoAmount == weap.AmmoType.MaxAmmo)) {
  10.                 // block pickup
  11.                 bAllowPickup = 0;
  12.                 return true;
  13.             }
  14.         }
  15.     }
  16.    if ( NextMutator != None )
  17.       return NextMutator.HandlePickupQuery(Other, item, bAllowPickup);
  18.    return false;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement