sp/src/game/shared/of2/of2_gamerules.cpp
//-----------------------------------------------------------------------------
// Purpose: Whether or not the NPC should drop a health vial
// Output : Returns true on success, false on failure.
//-----------------------------------------------------------------------------
Whether or not the NPC should drop a health vial
Output : Returns true on success, false on failure.
Whether or not the NPC should drop a health vial Output : Returns true on success false on failure .
bool COpposingForce2::NPC_ShouldDropGrenade( CBasePlayer *pRecipient )
	{
		if ( m_flLastGrenadeDropTime > gpGlobals->curtime )
			return false;
		int grenadeIndex = GetAmmoDef()->Index( "grenade" );
		int numGrenades = pRecipient->GetAmmoCount( grenadeIndex );
		if ( ( numGrenades < GetAmmoDef()->MaxCarry( grenadeIndex ) ) && ( random->RandomInt( 0, 2 ) == 0 ) )
			return true;
		return false;
	}
bool COpposingForce2 :: NPC_ShouldDropGrenade ( CBasePlayer * pRecipient ) { if ( m_flLastGrenadeDropTime > gpGlobals -> curtime ) return false ; int grenadeIndex = GetAmmoDef ( ) -> Index ( " " ) ; int numGrenades = pRecipient -> GetAmmoCount ( grenadeIndex ) ; if ( ( numGrenades < GetAmmoDef ( ) -> MaxCarry ( grenadeIndex ) ) && ( random -> RandomInt ( 0 , 2 ) == 0 ) ) return true ; return false ; }
Purpose: Whether or not the NPC should drop a health vial
Output : Returns true on success, false on failure.
Purpose : Whether or not the NPC should drop a health vial Output : Returns true on success false on failure .
// Can only do this every so often // If we're not maxed out on grenades and we've randomly okay'd it