- added Gez's submission for inventory restrictions but changed the added checks to be in the main CallTryPickup function.

SVN r3296 (trunk)
This commit is contained in:
Christoph Oelckers 2011-09-23 08:23:51 +00:00
commit 3c47a30249
17 changed files with 158 additions and 199 deletions

View file

@ -72,6 +72,30 @@ void AWeapon::Serialize (FArchive &arc)
//
//===========================================================================
bool AWeapon::TryPickupRestricted (AActor *&toucher)
{
// Wrong class, but try to pick up for ammo
if (ShouldStay())
{ // Can't pick up weapons for other classes in coop netplay
return false;
}
bool gaveSome = (NULL != AddAmmo (toucher, AmmoType1, AmmoGive1));
gaveSome |= (NULL != AddAmmo (toucher, AmmoType2, AmmoGive2));
if (gaveSome)
{
GoAwayAndDie ();
}
return gaveSome;
}
//===========================================================================
//
// AWeapon :: TryPickup
//
//===========================================================================
bool AWeapon::TryPickup (AActor *&toucher)
{
FState * ReadyState = FindState(NAME_Ready);