- Added option to specify the amount of ammo to be given by a WeaponGiver.

SVN r1357 (trunk)
This commit is contained in:
Christoph Oelckers 2009-01-18 08:20:29 +00:00
commit 51391f889c
3 changed files with 7 additions and 0 deletions

View file

@ -607,6 +607,8 @@ bool AWeaponGiver::TryPickup(AActor *&toucher)
if (weap != NULL)
{
weap->ItemFlags &= ~IF_ALWAYSPICKUP; // use the flag of this item only.
if (weap->AmmoGive1 >= 0) weap->AmmoGive1 = AmmoGive1;
if (weap->AmmoGive2 >= 0) weap->AmmoGive2 = AmmoGive2;
bool res = weap->CallTryPickup(toucher);
if (!res) weap->Destroy();
else GoAwayAndDie();