From 51391f889ce2d8b7766e75c5f31212804e6bf7e2 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 18 Jan 2009 08:20:29 +0000 Subject: [PATCH] - Added option to specify the amount of ammo to be given by a WeaponGiver. SVN r1357 (trunk) --- docs/rh-log.txt | 3 +++ src/g_shared/a_weapons.cpp | 2 ++ wadsrc/static/actors/shared/inventory.txt | 2 ++ 3 files changed, 7 insertions(+) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index a5cc43258..e85041a64 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -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) - fixed: Identification of Doom1 Freedoom IWAD did not work. - fixed: UDMF did not initialize a sector's light colors. diff --git a/src/g_shared/a_weapons.cpp b/src/g_shared/a_weapons.cpp index b74a4e203..d0bce101f 100644 --- a/src/g_shared/a_weapons.cpp +++ b/src/g_shared/a_weapons.cpp @@ -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(); diff --git a/wadsrc/static/actors/shared/inventory.txt b/wadsrc/static/actors/shared/inventory.txt index 129eac58d..5db058b32 100644 --- a/wadsrc/static/actors/shared/inventory.txt +++ b/wadsrc/static/actors/shared/inventory.txt @@ -327,6 +327,8 @@ Actor Weapon : Inventory native ACTOR WeaponGiver : Weapon native { + Weapon.AmmoGive1 -1 + Weapon.AmmoGive2 -1 } Actor WeaponHolder : Inventory native