- Added a DropAmmoFactor field to WeaponGiver so that ModifyDropAmount() can record the drop

amount modifier into it without fiddling with the actual AmmoGiveX fields.

SVN r4246 (trunk)
This commit is contained in:
Randy Heit 2013-05-02 00:24:53 +00:00
commit d86b16d540
3 changed files with 32 additions and 37 deletions

View file

@ -3025,6 +3025,11 @@ void ModifyDropAmount(AInventory *inv, int dropamount)
inv->Amount = inv->GetClass()->Meta.GetMetaInt (AIMETA_DropAmount, MAX(1, FixedMul(inv->Amount, dropammofactor)));
inv->ItemFlags |= flagmask;
}
else if (inv->IsKindOf (RUNTIME_CLASS(AWeaponGiver)))
{
static_cast<AWeaponGiver *>(inv)->DropAmmoFactor = dropammofactor;
inv->ItemFlags |= flagmask;
}
else if (inv->IsKindOf (RUNTIME_CLASS(AWeapon)))
{
// The same goes for ammo from a weapon.