void CASW_DamageAllocationMgr::Remove( const EHANDLE &handle ) { IndexType_t i = Find( handle ); if ( IsValid(i) ) { // strike all projectiles for this target ProjectilePool_t::IndexLocalType_t j = i->m_nProjectiles; while ( m_ProjectileLists.IsValidIndex(j) ) { ProjectilePool_t::IndexLocalType_t old = j; j = m_ProjectileLists.Next(j); m_ProjectileLists.Remove( old ); } int vectoridx = i - m_Targets.Base(); Assert( &m_Targets[vectoridx] == i ); m_Targets.FastRemove( vectoridx ); } else { AssertMsg1( false, "Tried to remove %s from a damage allocation manager whence it was absent.\n", handle->GetDebugName() ); } }
//----------------------------------------------------------------------------- // Purpose: Draw any debug text overlays // Output : Current text offset from the top //----------------------------------------------------------------------------- int CFuncTank::DrawDebugTextOverlays(void) { int text_offset = BaseClass::DrawDebugTextOverlays(); if (m_debugOverlays & OVERLAY_TEXT_BIT) { // -------------- // State // -------------- char tempstr[255]; if (IsActive()) { Q_strncpy(tempstr,"State: Active",sizeof(tempstr)); } else { Q_strncpy(tempstr,"State: Inactive",sizeof(tempstr)); } EntityText(text_offset,tempstr,0); text_offset++; // ------------------- // Print Firing Speed // -------------------- Q_snprintf(tempstr,sizeof(tempstr),"Fire Rate: %f",m_fireRate); EntityText(text_offset,tempstr,0); text_offset++; // -------------- // Print Target // -------------- if (m_hTarget!=NULL) { Q_snprintf(tempstr,sizeof(tempstr),"Target: %s",m_hTarget->GetDebugName()); } else { Q_snprintf(tempstr,sizeof(tempstr),"Target: - "); } EntityText(text_offset,tempstr,0); text_offset++; // -------------- // Target Pos // -------------- if (m_spawnflags & SF_TANK_AIM_AT_POS) { Q_snprintf(tempstr,sizeof(tempstr),"Aim Pos: %3.0f %3.0f %3.0f",m_vTargetPosition.x,m_vTargetPosition.y,m_vTargetPosition.z); } else { Q_snprintf(tempstr,sizeof(tempstr),"Aim Pos: - "); } EntityText(text_offset,tempstr,0); text_offset++; } return text_offset; }
//----------------------------------------------------------------------------- // Purpose: Draw any debug text overlays //----------------------------------------------------------------------------- int CNPC_CombineCamera::DrawDebugTextOverlays(void) { int text_offset = BaseClass::DrawDebugTextOverlays(); if (m_debugOverlays & OVERLAY_TEXT_BIT) { char tempstr[512]; Q_snprintf( tempstr, sizeof( tempstr ),"Enemy : %s", m_hEnemyTarget ? m_hEnemyTarget->GetDebugName() : "<none>"); EntityText(text_offset,tempstr,0); text_offset++; } return text_offset; }