diff --git a/src/game/server/tf/entity_currencypack.cpp b/src/game/server/tf/entity_currencypack.cpp index b2dc51de4..f9a18b51a 100644 --- a/src/game/server/tf/entity_currencypack.cpp +++ b/src/game/server/tf/entity_currencypack.cpp @@ -17,6 +17,7 @@ #include "particle_parse.h" #include "player_vs_environment/tf_population_manager.h" #include "collisionutils.h" +#include "func_respawnroom.h" #include "tf_objective_resource.h" //============================================================================= @@ -209,6 +210,19 @@ void CCurrencyPack::ComeToRest( void ) } } } + // Or a func_respawnroom (robots can drop money in their own spawn) + for ( int i = 0; i < IFuncRespawnRoomAutoList::AutoList().Count(); i++ ) + { + 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 ); + } + } } //-----------------------------------------------------------------------------