Fix weapon respawn bug

This commit is contained in:
mittorn 2016-08-17 19:40:03 +00:00
parent 6e6d539727
commit 11278977d4
1 changed files with 7 additions and 2 deletions

View File

@ -478,6 +478,8 @@ void CBasePlayerItem::FallThink( void )
//=========================================================
void CBasePlayerItem::Materialize( void )
{
ALERT( at_console, "Materialize: %s\n", STRING(pev->classname) );
if( pev->effects & EF_NODRAW )
{
// changing from invisible state to visible.
@ -509,8 +511,11 @@ float CBasePlayerItem::TouchGravGun( CBaseEntity *attacker, int stage )
return 0;
if( pev->effects & EF_NODRAW )
return 0;
if( m_pfnThink == NULL || m_pfnThink == &CBasePlayerItem::AttemptToMaterialize )
{
SetThink( &CBasePlayerItem::AttemptToMaterialize );
pev->nextthink = gpGlobals->time + 60;;
pev->nextthink = g_pGameRules->FlWeaponRespawnTime(this);
}
//if( pev->mins == pev->maxs )
//return 0;
return 200;