- 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
parent b4b76ed4e6
commit 51391f889c
3 changed files with 7 additions and 0 deletions

View file

@ -1,3 +1,6 @@
January 11, 2009 (Changes by Graf Zahl)
- Added option to specify the amount of ammo to be given by a WeaponGiver.
January 10, 2009 (Changes by Graf Zahl) January 10, 2009 (Changes by Graf Zahl)
- fixed: Identification of Doom1 Freedoom IWAD did not work. - fixed: Identification of Doom1 Freedoom IWAD did not work.
- fixed: UDMF did not initialize a sector's light colors. - fixed: UDMF did not initialize a sector's light colors.

View file

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

View file

@ -327,6 +327,8 @@ Actor Weapon : Inventory native
ACTOR WeaponGiver : Weapon native ACTOR WeaponGiver : Weapon native
{ {
Weapon.AmmoGive1 -1
Weapon.AmmoGive2 -1
} }
Actor WeaponHolder : Inventory native Actor WeaponHolder : Inventory native