- Added Hirogen2's patch for unlimited ammo CVAR.

SVN r1464 (trunk)
This commit is contained in:
Christoph Oelckers 2009-03-06 22:58:34 +00:00
commit e57ff454f2
5 changed files with 13 additions and 5 deletions

View file

@ -67,13 +67,14 @@ const PClass *AAmmo::GetParentAmmo () const
// AAmmo :: HandlePickup
//
//===========================================================================
EXTERN_CVAR(Bool, sv_unlimited_pickup)
bool AAmmo::HandlePickup (AInventory *item)
{
if (GetClass() == item->GetClass() ||
(item->IsKindOf (RUNTIME_CLASS(AAmmo)) && static_cast<AAmmo*>(item)->GetParentAmmo() == GetClass()))
{
if (Amount < MaxAmount)
if (Amount < MaxAmount || sv_unlimited_pickup)
{
int receiving = item->Amount;
@ -84,7 +85,7 @@ bool AAmmo::HandlePickup (AInventory *item)
int oldamount = Amount;
Amount += receiving;
if (Amount > MaxAmount)
if (Amount > MaxAmount && !sv_unlimited_pickup)
{
Amount = MaxAmount;
}