This commit is contained in:
parent
dc14c36d6c
commit
6e16891116
4 changed files with 106 additions and 26 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue