Intended fix collect weapons by others players if you die on MH server.
Usually on MH servers ammo increase automatically, so you do not need collect weapon or ammo. Exclude WarHead.
But if you die and your weapons collected it can be pity for you.
Mutator written maximally compatible and must work with any others.
It must be first in chain for properly work.
Code: Select all
class DenyPickupWeaponTwice extends Mutator;
function bool HandlePickupQuery(Pawn Other, Inventory item, out byte bAllowPickup) {
Local Weapon weap;
if (item.isA('Weapon')) {
weap = Weapon(Other.FindInventoryType(item.Class));
if (weap != None) {
bAllowPickup = 0;
if (item.isA('WarHeadLauncher') && weap.AmmoType != None && weap.AmmoType.AmmoAmount < weap.AmmoType.MaxAmmo) bAllowPickup = 1;
if (item.isA('Enforcer') && !weap.isA('DoubleEnforcer')) bAllowPickup = 1;
if (bAllowPickup == 0) return true;
}
}
return super.HandlePickupQuery(Other, item, bAllowPickup);
}