- added Hirogen2's Backpack fix for sv_unlimited_pickup.

SVN r2054 (trunk)
This commit is contained in:
Christoph Oelckers 2009-12-28 00:07:04 +00:00
parent 4a8518e4f1
commit b6557a82ff
2 changed files with 3 additions and 2 deletions

View file

@ -1,4 +1,5 @@
December 27, 2009 (Changes by Graf Zahl) December 27, 2009 (Changes by Graf Zahl)
- added Hirogen2's Backpack fix for sv_unlimited_pickup.
- added a linedef based method to define portals. Portals defined this way - added a linedef based method to define portals. Portals defined this way
still have the same limitations as those defines with the portal things. still have the same limitations as those defines with the portal things.

View file

@ -1638,7 +1638,7 @@ bool ABackpackItem::HandlePickup (AInventory *item)
{ {
if (probe->GetClass()->ParentClass == RUNTIME_CLASS(AAmmo)) if (probe->GetClass()->ParentClass == RUNTIME_CLASS(AAmmo))
{ {
if (probe->Amount < probe->MaxAmount) if (probe->Amount < probe->MaxAmount || sv_unlimited_pickup)
{ {
int amount = static_cast<AAmmo*>(probe->GetDefault())->BackpackAmount; int amount = static_cast<AAmmo*>(probe->GetDefault())->BackpackAmount;
// extra ammo in baby mode and nightmare mode // extra ammo in baby mode and nightmare mode
@ -1647,7 +1647,7 @@ bool ABackpackItem::HandlePickup (AInventory *item)
amount = FixedMul(amount, G_SkillProperty(SKILLP_AmmoFactor)); amount = FixedMul(amount, G_SkillProperty(SKILLP_AmmoFactor));
} }
probe->Amount += amount; probe->Amount += amount;
if (probe->Amount > probe->MaxAmount) if (probe->Amount > probe->MaxAmount && !sv_unlimited_pickup)
{ {
probe->Amount = probe->MaxAmount; probe->Amount = probe->MaxAmount;
} }