//----------------------------------------------------------------------------- // Purpose: // Input : inputdata - //----------------------------------------------------------------------------- void CEntityFlame::InputIgnite( inputdata_t &inputdata ) { if (m_target != NULL_STRING) { CBaseEntity *pTarget = NULL; while ((pTarget = gEntList.FindEntityGeneric(pTarget, STRING(m_target), this, inputdata.pActivator)) != NULL) { // Combat characters know how to catch themselves on fire. CBaseCombatCharacter *pBCC = pTarget->MyCombatCharacterPointer(); if (pBCC) { // DVS TODO: consider promoting Ignite to CBaseEntity and doing everything here pBCC->Ignite(m_flLifetime); } // Everything else, we handle here. else { CEntityFlame *pFlame = CEntityFlame::Create(pTarget); if (pFlame) { pFlame->SetLifetime(m_flLifetime); } } } } }
void CWeaponImmolator::ImmolationDamage( const CTakeDamageInfo &info, const Vector &vecSrcIn, float flRadius, int iClassIgnore ) { CBaseEntity *pEntity = NULL; trace_t tr; Vector vecSpot; Vector vecSrc = vecSrcIn; // iterate on all entities in the vicinity. for ( CEntitySphereQuery sphere( vecSrc, flRadius ); pEntity = sphere.GetCurrentEntity(); sphere.NextEntity() ) { CBaseCombatCharacter *pBCC; pBCC = pEntity->MyCombatCharacterPointer(); if ( pBCC && !pBCC->IsOnFire() ) { // UNDONE: this should check a damage mask, not an ignore if ( iClassIgnore != CLASS_NONE && pEntity->Classify() == iClassIgnore ) { continue; } if( pEntity == GetOwner() ) { continue; } pBCC->Ignite( random->RandomFloat( 15, 20 ) ); } } }