Browse Source

Preserve weapon enttools owner on respawn

gravgun
mittorn 6 years ago
parent
commit
2d34d48500
  1. 4
      dlls/weapons.cpp

4
dlls/weapons.cpp

@ -606,6 +606,8 @@ CBaseEntity* CBasePlayerItem::Respawn( void )
DROP_TO_FLOOR( ENT( pev ) ); DROP_TO_FLOOR( ENT( pev ) );
pNewWeapon->enttools_data = enttools_data;
// not a typo! We want to know when the weapon the player just picked up should respawn! This new entity we created is the replacement, // not a typo! We want to know when the weapon the player just picked up should respawn! This new entity we created is the replacement,
// but when it should respawn is based on conditions belonging to the weapon that was taken. // but when it should respawn is based on conditions belonging to the weapon that was taken.
pNewWeapon->pev->nextthink = g_pGameRules->FlWeaponRespawnTime( this ); pNewWeapon->pev->nextthink = g_pGameRules->FlWeaponRespawnTime( this );
@ -822,6 +824,8 @@ void CBasePlayerItem::AttachToPlayer( CBasePlayer *pPlayer )
pev->nextthink = 0;// Remove think - prevents futher attempts to materialize pev->nextthink = 0;// Remove think - prevents futher attempts to materialize
SetTouch( NULL ); SetTouch( NULL );
SetThink( NULL ); SetThink( NULL );
enttools_data.enttools = false;
} }
// CALLED THROUGH the newly-touched weapon's instance. The existing player weapon is pOriginal // CALLED THROUGH the newly-touched weapon's instance. The existing player weapon is pOriginal

Loading…
Cancel
Save