From 11278977d46d2de285ec323cccfb9c476d5f3187 Mon Sep 17 00:00:00 2001 From: mittorn Date: Wed, 17 Aug 2016 19:40:03 +0000 Subject: [PATCH] Fix weapon respawn bug --- dlls/weapons.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dlls/weapons.cpp b/dlls/weapons.cpp index 95ef87ac..55e5db12 100644 --- a/dlls/weapons.cpp +++ b/dlls/weapons.cpp @@ -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; - SetThink( &CBasePlayerItem::AttemptToMaterialize ); - pev->nextthink = gpGlobals->time + 60;; + if( m_pfnThink == NULL || m_pfnThink == &CBasePlayerItem::AttemptToMaterialize ) + { + SetThink( &CBasePlayerItem::AttemptToMaterialize ); + pev->nextthink = g_pGameRules->FlWeaponRespawnTime(this); + } //if( pev->mins == pev->maxs ) //return 0; return 200;