//----------------------------------------------------------------------------- // Purpose: Returns true if there are any undetonated charges in the world // that belong to this player // Input : // Output : //----------------------------------------------------------------------------- bool CWeapon_SLAM::AnyUndetonatedCharges(void) { CBaseEntity *pEntity = NULL; while ((pEntity = gEntList.FindEntityByClassname( pEntity, "npc_satchel" )) != NULL) { CSatchelCharge* pSatchel = dynamic_cast<CSatchelCharge *>(pEntity); if (pSatchel->m_bIsLive && pSatchel->GetThrower() && pSatchel->GetThrower() == GetOwner()) { return true; } } return false; }
//----------------------------------------------------------------------------- // Purpose: // Input : // Output : //----------------------------------------------------------------------------- void CWeapon_SLAM::SatchelDetonate() { CBaseEntity *pEntity = NULL; while ((pEntity = gEntList.FindEntityByClassname( pEntity, "npc_satchel" )) != NULL) { CSatchelCharge *pSatchel = dynamic_cast<CSatchelCharge *>(pEntity); if (pSatchel->m_bIsLive && pSatchel->GetThrower() && GetOwner() && pSatchel->GetThrower() == GetOwner()) { pSatchel->Use( GetOwner(), GetOwner(), USE_ON, 0 ); } } // Play sound for pressing the detonator EmitSound( "Weapon_SLAM.SatchelDetonate" ); m_bDetonatorArmed = false; }
//----------------------------------------------------------------------------- // Purpose: // Input : // Output : //----------------------------------------------------------------------------- void CWeapon_SLAM::SatchelDetonate() { #ifndef CLIENT_DLL CBaseEntity *pEntity = NULL; while ((pEntity = gEntList.FindEntityByClassname( pEntity, "npc_satchel" )) != NULL) { CSatchelCharge *pSatchel = dynamic_cast<CSatchelCharge *>(pEntity); if (pSatchel->m_bIsLive && pSatchel->GetThrower() && GetOwner() && pSatchel->GetThrower() == GetOwner()) { //pSatchel->Use( GetOwner(), GetOwner(), USE_ON, 0 ); //variant_t emptyVariant; //pSatchel->AcceptInput( "Explode", NULL, NULL, emptyVariant, 5 ); g_EventQueue.AddEvent( pSatchel, "Explode", 0.20, GetOwner(), GetOwner() ); } } #endif // Play sound for pressing the detonator EmitSound( "Weapon_SLAM.SatchelDetonate" ); m_bDetonatorArmed = false; }
void CHL2MP_Player::DetonateTripmines( void ) { CBaseEntity *pEntity = NULL; while ((pEntity = gEntList.FindEntityByClassname( pEntity, "npc_satchel" )) != NULL) { CSatchelCharge *pSatchel = dynamic_cast<CSatchelCharge *>(pEntity); if (pSatchel->m_bIsLive && pSatchel->GetThrower() == this ) { g_EventQueue.AddEvent( pSatchel, "Explode", 0.20, this, this ); } } // Play sound for pressing the detonator EmitSound( "Weapon_SLAM.SatchelDetonate" ); }