- Added Gez's dropammofactor submission with some necessary changes. Also merged
redundant ammo multiplication code from P_DropItem and ADehackedPickup::TryPickup. - Restricted native action function definitions to zdoom.pk3. SVN r1123 (trunk)
This commit is contained in:
parent
344f1072a6
commit
0ad1bfe87e
9 changed files with 82 additions and 34 deletions
|
|
@ -2603,6 +2603,8 @@ void FinishDehPatch ()
|
|||
}
|
||||
}
|
||||
|
||||
void ModifyDropAmount(AInventory *inv, int dropamount);
|
||||
|
||||
bool ADehackedPickup::TryPickup (AActor *toucher)
|
||||
{
|
||||
const PClass *type = DetermineType ();
|
||||
|
|
@ -2618,18 +2620,10 @@ bool ADehackedPickup::TryPickup (AActor *toucher)
|
|||
RealPickup->flags &= ~MF_DROPPED;
|
||||
}
|
||||
// If this item has been dropped by a monster the
|
||||
// amount of ammo this gives must be halved.
|
||||
// amount of ammo this gives must be adjusted.
|
||||
if (droppedbymonster)
|
||||
{
|
||||
if (RealPickup->IsKindOf(RUNTIME_CLASS(AWeapon)))
|
||||
{
|
||||
static_cast<AWeapon *>(RealPickup)->AmmoGive1 /= 2;
|
||||
static_cast<AWeapon *>(RealPickup)->AmmoGive2 /= 2;
|
||||
}
|
||||
else if (RealPickup->IsKindOf(RUNTIME_CLASS(AAmmo)))
|
||||
{
|
||||
RealPickup->Amount /= 2;
|
||||
}
|
||||
ModifyDropAmount(RealPickup, 0);
|
||||
}
|
||||
if (!RealPickup->TryPickup (toucher))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue