diff --git a/src/game/server/tf/entity_currencypack.cpp b/src/game/server/tf/entity_currencypack.cpp index 480f9d50394..68524cb8070 100644 --- a/src/game/server/tf/entity_currencypack.cpp +++ b/src/game/server/tf/entity_currencypack.cpp @@ -189,41 +189,25 @@ void CCurrencyPack::ComeToRest( void ) TFGameRules()->DistributeCurrencyAmount( m_nAmount ); m_bTouched = true; UTIL_Remove( this ); - return; } // See if we've come to rest in a trigger_hurt - for ( int i = 0; i < ITriggerHurtAutoList::AutoList().Count(); i++ ) + if ( IsTakingTriggerHurtDamageAtPoint( GetAbsOrigin() ) ) { - CTriggerHurt *pTrigger = static_cast( ITriggerHurtAutoList::AutoList()[i] ); - if ( !pTrigger->m_bDisabled ) - { - Vector vecMins, vecMaxs; - pTrigger->GetCollideable()->WorldSpaceSurroundingBounds( &vecMins, &vecMaxs ); - if ( IsPointInBox( GetCollideable()->GetCollisionOrigin(), vecMins, vecMaxs ) ) - { - TFGameRules()->DistributeCurrencyAmount( m_nAmount ); - - m_bTouched = true; - UTIL_Remove( this ); - } - } + TFGameRules()->DistributeCurrencyAmount(m_nAmount); + m_bTouched = true; + UTIL_Remove(this); + return; } // Or a func_respawnroom (robots can drop money in their own spawn) - for ( int i = 0; i < IFuncRespawnRoomAutoList::AutoList().Count(); i++ ) + if ( PointInRespawnRoom( NULL, GetAbsOrigin() ) ) { - CFuncRespawnRoom *pRespawnRoom = static_cast( IFuncRespawnRoomAutoList::AutoList()[ i ] ); - Vector vecMins, vecMaxs; - pRespawnRoom->GetCollideable()->WorldSpaceSurroundingBounds( &vecMins, &vecMaxs ); - if ( IsPointInBox( GetCollideable()->GetCollisionOrigin(), vecMins, vecMaxs ) ) - { - TFGameRules()->DistributeCurrencyAmount( m_nAmount ); - - m_bTouched = true; - UTIL_Remove( this ); - } + TFGameRules()->DistributeCurrencyAmount(m_nAmount); + m_bTouched = true; + UTIL_Remove(this); + return; } }