mirror of
https://github.com/ValveSoftware/source-sdk-2013.git
synced 2025-05-10 22:09:29 +03:00
gameplay: automatically collect MvM money in respawn room
MvM money is automatically collected in various cases where its position is unfair for players to collect themselves. there is a case where robots can drop money in their own spawn, which can prove hard or impossible to acquire so add an additional check for money which is in a spawn room, just like trigger_hurt
This commit is contained in:
parent
0565403b15
commit
52e568b374
@ -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<CFuncRespawnRoom*>( 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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user