- Fixed: Crash when opening the player setup menu when you're so dead that

your head has popped off your body.
- Fixed: When item respawning is on and you play on skill 1 or 5, picking
  up ammo would permanently double the amount of ammo received from that
  item the next time it gets picked up.
- Added a check to PlayerIsGone() for players who have already had their
  actors destroyed before calling it.
- Fixed: G_CheckDemoStatus() only restored your name, autoaim, and color
  settings after playing back a demo.
- Added DEM_SPRAY net command so that sprayed decals work in multiplayer
  and demos.
- Changed DEM_GIVECHEAT to use a word for specifying the item quantity.
  This is useful mainly for giving yourself more than 255 health at a time.
- Fixed: DEM_SUMMONFRIEND was not handled by Net_SkipCommand().


SVN r58 (trunk)
This commit is contained in:
Randy Heit 2006-04-21 05:44:21 +00:00
commit 8ea6569de8
12 changed files with 118 additions and 79 deletions

View file

@ -59,31 +59,6 @@ const TypeInfo *AAmmo::GetParentAmmo () const
return type;
}
//===========================================================================
//
// AAmmo :: TryPickup
//
//===========================================================================
bool AAmmo::TryPickup (AActor *toucher)
{
int count = Amount;
if (gameskill == sk_baby || (gameskill == sk_nightmare && gameinfo.gametype != GAME_Strife))
{ // extra ammo in baby mode and nightmare mode
if (gameinfo.gametype & (GAME_Doom|GAME_Strife))
Amount <<= 1;
else
Amount += Amount >> 1;
}
if (!Super::TryPickup (toucher))
{
Amount = count;
return false;
}
return true;
}
//===========================================================================
//
// AAmmo :: HandlePickup
@ -97,8 +72,18 @@ bool AAmmo::HandlePickup (AInventory *item)
{
if (Amount < MaxAmount)
{
int receiving = item->Amount;
// extra ammo in baby mode and nightmare mode
if (gameskill == sk_baby || (gameskill == sk_nightmare && gameinfo.gametype != GAME_Strife))
{
if (gameinfo.gametype & (GAME_Doom|GAME_Strife))
receiving <<= 1;
else
receiving += receiving >> 1;
}
int oldamount = Amount;
Amount += item->Amount;
Amount += receiving;
if (Amount > MaxAmount)
{
Amount = MaxAmount;
@ -143,6 +128,16 @@ bool AAmmo::HandlePickup (AInventory *item)
AInventory *AAmmo::CreateCopy (AActor *other)
{
AInventory *copy;
int amount = Amount;
// extra ammo in baby mode and nightmare mode
if (gameskill == sk_baby || (gameskill == sk_nightmare && gameinfo.gametype != GAME_Strife))
{
if (gameinfo.gametype & (GAME_Doom|GAME_Strife))
amount <<= 1;
else
amount += amount >> 1;
}
if (GetClass()->ParentType != RUNTIME_CLASS(AAmmo))
{
@ -152,12 +147,13 @@ AInventory *AAmmo::CreateCopy (AActor *other)
Destroy ();
}
copy = static_cast<AInventory *>(Spawn (type, 0, 0, 0));
copy->Amount = Amount;
copy->Amount = amount;
copy->BecomeItem ();
}
else
{
copy = Super::CreateCopy (other);
copy->Amount = amount;
}
if (copy->Amount > copy->MaxAmount)
{ // Don't pick up more ammo than you're supposed to be able to carry.