This commit is contained in:
Paul 2001-05-29 18:22:49 +00:00
parent dc14c36d6c
commit 6e16891116
4 changed files with 106 additions and 26 deletions

View file

@ -281,6 +281,42 @@ void CBaseRespawningPickup::collect(class CPlayer *_player)
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CBaseWeaponPickup::init()
{
CBasePickup::init();
m_dontAutoPickUpUntilPlayerMovesOffMe=true;
m_collidedWithPlayer=true;
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CBaseWeaponPickup::think(int _frames)
{
CBasePickup::think(_frames);
if(!m_collidedWithPlayer)
{
m_dontAutoPickUpUntilPlayerMovesOffMe=false;
}
else
{
m_collidedWithPlayer=false;
}
}
/*----------------------------------------------------------------------
Function:
Purpose:
@ -292,9 +328,18 @@ void CBaseWeaponPickup::collidedWith(CThing *_thisThing)
switch(_thisThing->getThingType())
{
case TYPE_PLAYER:
if(((CPlayer*)_thisThing)->tryingToPickupWeapon())
{
collect((CPlayer*)_thisThing);
CPlayer *player;
player=(CPlayer*)_thisThing;
if(player->tryingToManuallyPickupWeapon()||
(!m_dontAutoPickUpUntilPlayerMovesOffMe&&player->tryingToAutomaticallyPickupWeapon()))
{
collect(player);
}
else
{
m_collidedWithPlayer=true;
}
}
break;