aboutsummaryrefslogtreecommitdiff
path: root/mp/src/game/server/team_control_point_master.cpp
diff options
context:
space:
mode:
authorJoe Ludwig <[email protected]>2013-07-17 18:26:59 -0700
committerJoe Ludwig <[email protected]>2013-07-17 18:26:59 -0700
commite16ea21dc8a710237ade8413207f58d403c616a3 (patch)
tree85dcfbda9881e4e022dedafefbc2727e2fd2aa59 /mp/src/game/server/team_control_point_master.cpp
parentMerge pull request #36 from AnAkIn1/fogplayerparams_fix (diff)
downloadsource-sdk-2013-e16ea21dc8a710237ade8413207f58d403c616a3.tar.xz
source-sdk-2013-e16ea21dc8a710237ade8413207f58d403c616a3.zip
* Added support for building shaders in your mod
* Added nav mesh support * fixed many warnings and misc bugs * Fixed the create*projects scripts in mp * Added a bunch of stuff to .gitignore
Diffstat (limited to 'mp/src/game/server/team_control_point_master.cpp')
-rw-r--r--mp/src/game/server/team_control_point_master.cpp34
1 files changed, 28 insertions, 6 deletions
diff --git a/mp/src/game/server/team_control_point_master.cpp b/mp/src/game/server/team_control_point_master.cpp
index 6a579e01..662d8200 100644
--- a/mp/src/game/server/team_control_point_master.cpp
+++ b/mp/src/game/server/team_control_point_master.cpp
@@ -24,6 +24,9 @@ BEGIN_DATADESC( CTeamControlPointMaster )
DEFINE_KEYFIELD( m_flPartialCapturePointsRate, FIELD_FLOAT, "partial_cap_points_rate" ),
+ DEFINE_KEYFIELD( m_flCustomPositionX, FIELD_FLOAT, "custom_position_x" ),
+ DEFINE_KEYFIELD( m_flCustomPositionY, FIELD_FLOAT, "custom_position_y" ),
+
// DEFINE_FIELD( m_ControlPoints, CUtlMap < int , CTeamControlPoint * > ),
// DEFINE_FIELD( m_bFoundPoints, FIELD_BOOLEAN ),
// DEFINE_FIELD( m_ControlPointRounds, CUtlVector < CTeamControlPointRound * > ),
@@ -40,6 +43,8 @@ BEGIN_DATADESC( CTeamControlPointMaster )
DEFINE_INPUTFUNC( FIELD_VOID, "RoundSpawn", InputRoundSpawn ),
DEFINE_INPUTFUNC( FIELD_VOID, "RoundActivate", InputRoundActivate ),
DEFINE_INPUTFUNC( FIELD_STRING, "SetCapLayout", InputSetCapLayout ),
+ DEFINE_INPUTFUNC( FIELD_FLOAT, "SetCapLayoutCustomPositionX", InputSetCapLayoutCustomPositionX ),
+ DEFINE_INPUTFUNC( FIELD_FLOAT, "SetCapLayoutCustomPositionY", InputSetCapLayoutCustomPositionY ),
DEFINE_FUNCTION( CPMThink ),
@@ -70,6 +75,8 @@ int ControlPointRoundSort( CTeamControlPointRound* const *p1, CTeamControlPointR
CTeamControlPointMaster::CTeamControlPointMaster()
{
m_flPartialCapturePointsRate = 0.0f;
+ m_flCustomPositionX = -1.f;
+ m_flCustomPositionY = -1.f;
}
//-----------------------------------------------------------------------------
@@ -329,6 +336,7 @@ bool CTeamControlPointMaster::FindControlPointRounds( void )
{
g_pObjectiveResource->SetPlayingMiniRounds( bFoundRounds );
g_pObjectiveResource->SetCapLayoutInHUD( STRING(m_iszCapLayoutInHUD) );
+ g_pObjectiveResource->SetCapLayoutCustomPosition( m_flCustomPositionX, m_flCustomPositionY );
}
return bFoundRounds;
@@ -837,15 +845,11 @@ void CTeamControlPointMaster::InputRoundSpawn( inputdata_t &input )
// init the ClientAreas
int index = 0;
- CBaseEntity *pEnt = gEntList.FindEntityByClassname( NULL, GetTriggerAreaCaptureName() );
- while( pEnt )
+ for ( int i=0; i<ITriggerAreaCaptureAutoList::AutoList().Count(); ++i )
{
- CTriggerAreaCapture *pArea = (CTriggerAreaCapture *)pEnt;
- Assert( pArea );
+ CTriggerAreaCapture *pArea = static_cast< CTriggerAreaCapture * >( ITriggerAreaCaptureAutoList::AutoList()[i] );
pArea->SetAreaIndex( index );
index++;
-
- pEnt = gEntList.FindEntityByClassname( pEnt, GetTriggerAreaCaptureName() );
}
ObjectiveResource()->ResetControlPoints();
@@ -892,6 +896,24 @@ void CTeamControlPointMaster::InputSetCapLayout( inputdata_t &inputdata )
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
+void CTeamControlPointMaster::InputSetCapLayoutCustomPositionX( inputdata_t &inputdata )
+{
+ m_flCustomPositionX = inputdata.value.Float();
+ g_pObjectiveResource->SetCapLayoutCustomPosition( m_flCustomPositionX, m_flCustomPositionY );
+}
+
+//-----------------------------------------------------------------------------
+// Purpose:
+//-----------------------------------------------------------------------------
+void CTeamControlPointMaster::InputSetCapLayoutCustomPositionY( inputdata_t &inputdata )
+{
+ m_flCustomPositionY = inputdata.value.Float();
+ g_pObjectiveResource->SetCapLayoutCustomPosition( m_flCustomPositionX, m_flCustomPositionY );
+}
+
+//-----------------------------------------------------------------------------
+// Purpose:
+//-----------------------------------------------------------------------------
void CTeamControlPointMaster::FireTeamWinOutput( int iWinningTeam )
{
// Remap team so that first game team = 1