Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

472 lines
18 KiB

  1. //====== Copyright � 1996-2005, Valve Corporation, All rights reserved. =======
  2. //
  3. // Purpose: An entity that networks the state of the game's objectives.
  4. // May contain data for objectives that aren't used by your mod, but
  5. // the extra data will never be networked as long as it's zeroed out.
  6. //
  7. //=============================================================================
  8. #include "cbase.h"
  9. #include "team_objectiveresource.h"
  10. #include "shareddefs.h"
  11. #include <coordsize.h>
  12. #include "team.h"
  13. // memdbgon must be the last include file in a .cpp file!!!
  14. #include "tier0/memdbgon.h"
  15. #define CAPHUD_PARITY_BITS 6
  16. #define CAPHUD_PARITY_MASK ((1<<CAPHUD_PARITY_BITS)-1)
  17. #define LAZY_UPDATE_TIME 3
  18. // Datatable
  19. IMPLEMENT_SERVERCLASS_ST_NOBASE(CBaseTeamObjectiveResource, DT_BaseTeamObjectiveResource)
  20. SendPropInt( SENDINFO(m_iTimerToShowInHUD), MAX_EDICT_BITS, SPROP_UNSIGNED ),
  21. SendPropInt( SENDINFO(m_iStopWatchTimer), MAX_EDICT_BITS, SPROP_UNSIGNED ),
  22. SendPropInt( SENDINFO(m_iNumControlPoints), 4, SPROP_UNSIGNED ),
  23. SendPropBool( SENDINFO(m_bPlayingMiniRounds) ),
  24. SendPropBool( SENDINFO(m_bControlPointsReset) ),
  25. SendPropInt( SENDINFO(m_iUpdateCapHudParity), CAPHUD_PARITY_BITS, SPROP_UNSIGNED ),
  26. // data variables
  27. SendPropArray( SendPropVector( SENDINFO_ARRAY(m_vCPPositions), -1, SPROP_COORD), m_vCPPositions ),
  28. SendPropArray3( SENDINFO_ARRAY3(m_bCPIsVisible), SendPropInt( SENDINFO_ARRAY(m_bCPIsVisible), 1, SPROP_UNSIGNED ) ),
  29. SendPropArray3( SENDINFO_ARRAY3(m_flLazyCapPerc), SendPropFloat( SENDINFO_ARRAY(m_flLazyCapPerc) ) ),
  30. SendPropArray3( SENDINFO_ARRAY3(m_iTeamIcons), SendPropInt( SENDINFO_ARRAY(m_iTeamIcons), 8, SPROP_UNSIGNED ) ),
  31. SendPropArray3( SENDINFO_ARRAY3(m_iTeamOverlays), SendPropInt( SENDINFO_ARRAY(m_iTeamOverlays), 8, SPROP_UNSIGNED ) ),
  32. SendPropArray3( SENDINFO_ARRAY3(m_iTeamReqCappers), SendPropInt( SENDINFO_ARRAY(m_iTeamReqCappers), 4, SPROP_UNSIGNED ) ),
  33. SendPropArray3( SENDINFO_ARRAY3(m_flTeamCapTime), SendPropTime( SENDINFO_ARRAY(m_flTeamCapTime) ) ),
  34. SendPropArray3( SENDINFO_ARRAY3(m_iPreviousPoints), SendPropInt( SENDINFO_ARRAY(m_iPreviousPoints), 8 ) ),
  35. SendPropArray3( SENDINFO_ARRAY3(m_bTeamCanCap), SendPropBool( SENDINFO_ARRAY(m_bTeamCanCap) ) ),
  36. SendPropArray3( SENDINFO_ARRAY3(m_iTeamBaseIcons), SendPropInt( SENDINFO_ARRAY(m_iTeamBaseIcons), 8 ) ),
  37. SendPropArray3( SENDINFO_ARRAY3(m_iBaseControlPoints), SendPropInt( SENDINFO_ARRAY(m_iBaseControlPoints), 8 ) ),
  38. SendPropArray3( SENDINFO_ARRAY3(m_bInMiniRound), SendPropBool( SENDINFO_ARRAY(m_bInMiniRound) ) ),
  39. SendPropArray3( SENDINFO_ARRAY3(m_iWarnOnCap), SendPropInt( SENDINFO_ARRAY(m_iWarnOnCap), 4, SPROP_UNSIGNED ) ),
  40. SendPropArray( SendPropStringT( SENDINFO_ARRAY( m_iszWarnSound ) ), m_iszWarnSound ),
  41. SendPropArray3( SENDINFO_ARRAY3(m_flPathDistance), SendPropFloat( SENDINFO_ARRAY(m_flPathDistance), 8, 0, 0.0f, 1.0f ) ),
  42. // state variables
  43. SendPropArray3( SENDINFO_ARRAY3(m_iNumTeamMembers), SendPropInt( SENDINFO_ARRAY(m_iNumTeamMembers), 4, SPROP_UNSIGNED ) ),
  44. SendPropArray3( SENDINFO_ARRAY3(m_iCappingTeam), SendPropInt( SENDINFO_ARRAY(m_iCappingTeam), 4, SPROP_UNSIGNED ) ),
  45. SendPropArray3( SENDINFO_ARRAY3(m_iTeamInZone), SendPropInt( SENDINFO_ARRAY(m_iTeamInZone), 4, SPROP_UNSIGNED ) ),
  46. SendPropArray3( SENDINFO_ARRAY3(m_bBlocked), SendPropInt( SENDINFO_ARRAY(m_bBlocked), 1, SPROP_UNSIGNED ) ),
  47. SendPropArray3( SENDINFO_ARRAY3(m_iOwner), SendPropInt( SENDINFO_ARRAY(m_iOwner), 4, SPROP_UNSIGNED ) ),
  48. SendPropString( SENDINFO(m_pszCapLayoutInHUD) ),
  49. END_SEND_TABLE()
  50. BEGIN_DATADESC( CBaseTeamObjectiveResource )
  51. DEFINE_FIELD( m_iTimerToShowInHUD, FIELD_INTEGER ),
  52. DEFINE_FIELD( m_iStopWatchTimer, FIELD_INTEGER ),
  53. DEFINE_FIELD( m_iNumControlPoints, FIELD_INTEGER ),
  54. DEFINE_FIELD( m_bPlayingMiniRounds, FIELD_BOOLEAN ),
  55. DEFINE_FIELD( m_bControlPointsReset, FIELD_BOOLEAN ),
  56. DEFINE_FIELD( m_iUpdateCapHudParity, FIELD_INTEGER ),
  57. DEFINE_ARRAY( m_vCPPositions, FIELD_VECTOR, MAX_CONTROL_POINTS ),
  58. DEFINE_ARRAY( m_bCPIsVisible, FIELD_INTEGER, MAX_CONTROL_POINTS ),
  59. DEFINE_ARRAY( m_flLazyCapPerc, FIELD_FLOAT, MAX_CONTROL_POINTS ),
  60. DEFINE_ARRAY( m_iTeamIcons, FIELD_INTEGER, MAX_CONTROL_POINTS*MAX_CONTROL_POINT_TEAMS ),
  61. DEFINE_ARRAY( m_iTeamOverlays, FIELD_INTEGER, MAX_CONTROL_POINTS*MAX_CONTROL_POINT_TEAMS ),
  62. DEFINE_ARRAY( m_iTeamReqCappers, FIELD_INTEGER, MAX_CONTROL_POINTS*MAX_CONTROL_POINT_TEAMS ),
  63. DEFINE_ARRAY( m_flTeamCapTime, FIELD_FLOAT, MAX_CONTROL_POINTS*MAX_CONTROL_POINT_TEAMS ),
  64. DEFINE_ARRAY( m_iPreviousPoints, FIELD_INTEGER, MAX_CONTROL_POINTS*MAX_CONTROL_POINT_TEAMS*MAX_PREVIOUS_POINTS ),
  65. DEFINE_ARRAY( m_bTeamCanCap, FIELD_BOOLEAN, MAX_CONTROL_POINTS*MAX_CONTROL_POINT_TEAMS ),
  66. DEFINE_ARRAY( m_iTeamBaseIcons, FIELD_INTEGER, MAX_TEAMS ),
  67. DEFINE_ARRAY( m_iBaseControlPoints, FIELD_INTEGER, MAX_TEAMS ),
  68. DEFINE_ARRAY( m_bInMiniRound, FIELD_BOOLEAN, MAX_CONTROL_POINTS ),
  69. DEFINE_ARRAY( m_iWarnOnCap, FIELD_INTEGER, MAX_CONTROL_POINTS ),
  70. DEFINE_ARRAY( m_iszWarnSound, FIELD_STRING, MAX_CONTROL_POINTS ),
  71. DEFINE_ARRAY( m_iNumTeamMembers, FIELD_INTEGER, MAX_CONTROL_POINTS*MAX_CONTROL_POINT_TEAMS ),
  72. DEFINE_ARRAY( m_iCappingTeam, FIELD_INTEGER, MAX_CONTROL_POINTS ),
  73. DEFINE_ARRAY( m_iTeamInZone, FIELD_INTEGER, MAX_CONTROL_POINTS ),
  74. DEFINE_ARRAY( m_bBlocked, FIELD_BOOLEAN, MAX_CONTROL_POINTS ),
  75. DEFINE_ARRAY( m_iOwner, FIELD_INTEGER, MAX_CONTROL_POINTS ),
  76. DEFINE_ARRAY( m_pszCapLayoutInHUD, FIELD_CHARACTER, MAX_CAPLAYOUT_LENGTH ),
  77. DEFINE_ARRAY( m_flCapPercentages, FIELD_FLOAT, MAX_CONTROL_POINTS ),
  78. DEFINE_THINKFUNC( ObjectiveThink ),
  79. END_DATADESC()
  80. CBaseTeamObjectiveResource *g_pObjectiveResource = NULL;
  81. //-----------------------------------------------------------------------------
  82. // Purpose:
  83. //-----------------------------------------------------------------------------
  84. CBaseTeamObjectiveResource::CBaseTeamObjectiveResource()
  85. {
  86. g_pObjectiveResource = this;
  87. m_bPlayingMiniRounds = false;
  88. m_iUpdateCapHudParity = 0;
  89. m_bControlPointsReset = false;
  90. }
  91. //-----------------------------------------------------------------------------
  92. // Purpose:
  93. //-----------------------------------------------------------------------------
  94. CBaseTeamObjectiveResource::~CBaseTeamObjectiveResource()
  95. {
  96. Assert( g_pObjectiveResource == this );
  97. g_pObjectiveResource = NULL;
  98. }
  99. //-----------------------------------------------------------------------------
  100. // Purpose:
  101. //-----------------------------------------------------------------------------
  102. void CBaseTeamObjectiveResource::Spawn( void )
  103. {
  104. m_iNumControlPoints = 0;
  105. // If you hit this, you've got too many teams for the control point system to handle.
  106. Assert( GetNumberOfTeams() < MAX_CONTROL_POINT_TEAMS );
  107. for ( int i=0; i < MAX_CONTROL_POINTS; i++ )
  108. {
  109. // data variables
  110. m_vCPPositions.Set( i, vec3_origin );
  111. m_bCPIsVisible.Set( i, true );
  112. m_bBlocked.Set( i, false );
  113. // state variables
  114. m_iOwner.Set( i, TEAM_UNASSIGNED );
  115. m_iCappingTeam.Set( i, TEAM_UNASSIGNED );
  116. m_iTeamInZone.Set( i, TEAM_UNASSIGNED );
  117. m_bInMiniRound.Set( i, true );
  118. m_iWarnOnCap.Set( i, CP_WARN_NORMAL );
  119. m_flLazyCapPerc.Set( i, 0.0 );
  120. for ( int team = 0; team < MAX_CONTROL_POINT_TEAMS; team++ )
  121. {
  122. int iTeamIndex = TEAM_ARRAY( i, team );
  123. m_iTeamIcons.Set( iTeamIndex, 0 );
  124. m_iTeamOverlays.Set( iTeamIndex, 0 );
  125. m_iTeamReqCappers.Set( iTeamIndex, 0 );
  126. m_flTeamCapTime.Set( iTeamIndex, 0.0f );
  127. m_iNumTeamMembers.Set( TEAM_ARRAY( i, team ), 0 );
  128. for ( int ipoint = 0; ipoint < MAX_PREVIOUS_POINTS; ipoint++ )
  129. {
  130. int iIntIndex = ipoint + (i * MAX_PREVIOUS_POINTS) + (team * MAX_CONTROL_POINTS * MAX_PREVIOUS_POINTS);
  131. m_iPreviousPoints.Set( iIntIndex, -1 );
  132. }
  133. m_bTeamCanCap.Set( iTeamIndex, false );
  134. }
  135. }
  136. for ( int i = 0; i < MAX_TEAMS; i++ )
  137. {
  138. m_iBaseControlPoints.Set( i, -1 );
  139. }
  140. SetThink( &CBaseTeamObjectiveResource::ObjectiveThink );
  141. SetNextThink( gpGlobals->curtime + LAZY_UPDATE_TIME );
  142. }
  143. //-----------------------------------------------------------------------------
  144. // Purpose:
  145. //-----------------------------------------------------------------------------
  146. void CBaseTeamObjectiveResource::ObjectiveThink( void )
  147. {
  148. SetNextThink( gpGlobals->curtime + LAZY_UPDATE_TIME );
  149. for ( int i = 0; i < m_iNumControlPoints; i++ )
  150. {
  151. if ( m_iCappingTeam[i] )
  152. {
  153. m_flLazyCapPerc.Set( i, m_flCapPercentages[i] );
  154. }
  155. }
  156. }
  157. //-----------------------------------------------------------------------------
  158. // Purpose: The objective resource is always transmitted to clients
  159. //-----------------------------------------------------------------------------
  160. int CBaseTeamObjectiveResource::UpdateTransmitState()
  161. {
  162. // ALWAYS transmit to all clients.
  163. return SetTransmitState( FL_EDICT_ALWAYS );
  164. }
  165. //-----------------------------------------------------------------------------
  166. // Purpose: Round is starting, reset state
  167. //-----------------------------------------------------------------------------
  168. void CBaseTeamObjectiveResource::ResetControlPoints( void )
  169. {
  170. for ( int i=0; i < MAX_CONTROL_POINTS; i++ )
  171. {
  172. m_iCappingTeam.Set( i, TEAM_UNASSIGNED );
  173. m_iTeamInZone.Set( i, TEAM_UNASSIGNED );
  174. m_bInMiniRound.Set( i, true );
  175. for ( int team = 0; team < MAX_CONTROL_POINT_TEAMS; team++ )
  176. {
  177. m_iNumTeamMembers.Set( TEAM_ARRAY( i, team ), 0.0f );
  178. }
  179. }
  180. UpdateCapHudElement();
  181. m_bControlPointsReset = !m_bControlPointsReset;
  182. }
  183. //-----------------------------------------------------------------------------
  184. // Purpose: Data setting functions
  185. //-----------------------------------------------------------------------------
  186. void CBaseTeamObjectiveResource::SetNumControlPoints( int num )
  187. {
  188. Assert( num <= MAX_CONTROL_POINTS );
  189. m_iNumControlPoints = num;
  190. }
  191. //-----------------------------------------------------------------------------
  192. // Purpose:
  193. //-----------------------------------------------------------------------------
  194. void CBaseTeamObjectiveResource::SetCPIcons( int index, int iTeam, int iIcon )
  195. {
  196. AssertValidIndex(index);
  197. m_iTeamIcons.Set( TEAM_ARRAY( index, iTeam ), iIcon );
  198. }
  199. //-----------------------------------------------------------------------------
  200. // Purpose:
  201. //-----------------------------------------------------------------------------
  202. void CBaseTeamObjectiveResource::SetCPOverlays( int index, int iTeam, int iIcon )
  203. {
  204. AssertValidIndex(index);
  205. m_iTeamOverlays.Set( TEAM_ARRAY( index, iTeam ), iIcon );
  206. }
  207. //-----------------------------------------------------------------------------
  208. // Purpose:
  209. //-----------------------------------------------------------------------------
  210. void CBaseTeamObjectiveResource::SetTeamBaseIcons( int iTeam, int iBaseIcon )
  211. {
  212. Assert( iTeam >= 0 && iTeam < MAX_TEAMS );
  213. m_iTeamBaseIcons.Set( iTeam, iBaseIcon );
  214. }
  215. //-----------------------------------------------------------------------------
  216. // Purpose:
  217. //-----------------------------------------------------------------------------
  218. void CBaseTeamObjectiveResource::SetCPPosition( int index, const Vector& vPosition )
  219. {
  220. AssertValidIndex(index);
  221. m_vCPPositions.Set( index, vPosition );
  222. }
  223. //-----------------------------------------------------------------------------
  224. // Purpose:
  225. //-----------------------------------------------------------------------------
  226. void CBaseTeamObjectiveResource::SetCPVisible( int index, bool bVisible )
  227. {
  228. AssertValidIndex(index);
  229. m_bCPIsVisible.Set( index, bVisible );
  230. }
  231. //-----------------------------------------------------------------------------
  232. // Purpose:
  233. //-----------------------------------------------------------------------------
  234. void CBaseTeamObjectiveResource::SetWarnOnCap( int index, int iWarnLevel )
  235. {
  236. AssertValidIndex(index);
  237. m_iWarnOnCap.Set( index, iWarnLevel );
  238. }
  239. //-----------------------------------------------------------------------------
  240. // Purpose:
  241. //-----------------------------------------------------------------------------
  242. void CBaseTeamObjectiveResource::SetWarnSound( int index, string_t iszSound )
  243. {
  244. AssertValidIndex(index);
  245. m_iszWarnSound.Set( index, iszSound );
  246. }
  247. //-----------------------------------------------------------------------------
  248. // Purpose:
  249. //-----------------------------------------------------------------------------
  250. void CBaseTeamObjectiveResource::SetCPRequiredCappers( int index, int iTeam, int iReqPlayers )
  251. {
  252. AssertValidIndex(index);
  253. m_iTeamReqCappers.Set( TEAM_ARRAY( index, iTeam ), iReqPlayers );
  254. }
  255. //-----------------------------------------------------------------------------
  256. // Purpose:
  257. //-----------------------------------------------------------------------------
  258. void CBaseTeamObjectiveResource::SetCPCapTime( int index, int iTeam, float flTime )
  259. {
  260. AssertValidIndex(index);
  261. m_flTeamCapTime.Set( TEAM_ARRAY( index, iTeam ), flTime );
  262. }
  263. //-----------------------------------------------------------------------------
  264. // Purpose:
  265. //-----------------------------------------------------------------------------
  266. void CBaseTeamObjectiveResource::SetCPCapPercentage( int index, float flTime )
  267. {
  268. AssertValidIndex(index);
  269. m_flCapPercentages[index] = flTime;
  270. }
  271. //-----------------------------------------------------------------------------
  272. // Purpose:
  273. //-----------------------------------------------------------------------------
  274. float CBaseTeamObjectiveResource::GetCPCapPercentage( int index )
  275. {
  276. AssertValidIndex(index);
  277. return m_flCapPercentages[index];
  278. }
  279. //-----------------------------------------------------------------------------
  280. // Purpose:
  281. //-----------------------------------------------------------------------------
  282. void CBaseTeamObjectiveResource::SetTeamCanCap( int index, int iTeam, bool bCanCap )
  283. {
  284. AssertValidIndex(index);
  285. m_bTeamCanCap.Set( TEAM_ARRAY( index, iTeam ), bCanCap );
  286. UpdateCapHudElement();
  287. }
  288. //-----------------------------------------------------------------------------
  289. // Purpose:
  290. //-----------------------------------------------------------------------------
  291. void CBaseTeamObjectiveResource::SetBaseCP( int index, int iTeam )
  292. {
  293. Assert( iTeam < MAX_TEAMS );
  294. m_iBaseControlPoints.Set( iTeam, index );
  295. }
  296. //-----------------------------------------------------------------------------
  297. // Purpose:
  298. //-----------------------------------------------------------------------------
  299. void CBaseTeamObjectiveResource::SetPreviousPoint( int index, int iTeam, int iPrevIndex, int iPrevPoint )
  300. {
  301. AssertValidIndex(index);
  302. Assert( iPrevIndex >= 0 && iPrevIndex < MAX_PREVIOUS_POINTS );
  303. int iIntIndex = iPrevIndex + (index * MAX_PREVIOUS_POINTS) + (iTeam * MAX_CONTROL_POINTS * MAX_PREVIOUS_POINTS);
  304. m_iPreviousPoints.Set( iIntIndex, iPrevPoint );
  305. }
  306. //-----------------------------------------------------------------------------
  307. // Purpose:
  308. //-----------------------------------------------------------------------------
  309. int CBaseTeamObjectiveResource::GetPreviousPointForPoint( int index, int team, int iPrevIndex )
  310. {
  311. AssertValidIndex(index);
  312. Assert( iPrevIndex >= 0 && iPrevIndex < MAX_PREVIOUS_POINTS );
  313. int iIntIndex = iPrevIndex + (index * MAX_PREVIOUS_POINTS) + (team * MAX_CONTROL_POINTS * MAX_PREVIOUS_POINTS);
  314. return m_iPreviousPoints[ iIntIndex ];
  315. }
  316. //-----------------------------------------------------------------------------
  317. // Purpose:
  318. //-----------------------------------------------------------------------------
  319. bool CBaseTeamObjectiveResource::TeamCanCapPoint( int index, int team )
  320. {
  321. AssertValidIndex(index);
  322. return m_bTeamCanCap[ TEAM_ARRAY( index, team ) ];
  323. }
  324. //-----------------------------------------------------------------------------
  325. // Purpose: Data setting functions
  326. //-----------------------------------------------------------------------------
  327. void CBaseTeamObjectiveResource::SetNumPlayers( int index, int team, int iNumPlayers )
  328. {
  329. AssertValidIndex(index);
  330. m_iNumTeamMembers.Set( TEAM_ARRAY( index, team ), iNumPlayers );
  331. UpdateCapHudElement();
  332. }
  333. //-----------------------------------------------------------------------------
  334. // Purpose:
  335. //-----------------------------------------------------------------------------
  336. void CBaseTeamObjectiveResource::StartCap( int index, int team )
  337. {
  338. AssertValidIndex(index);
  339. if ( m_iCappingTeam.Get( index ) != team )
  340. {
  341. m_iCappingTeam.Set( index, team );
  342. UpdateCapHudElement();
  343. }
  344. }
  345. //-----------------------------------------------------------------------------
  346. // Purpose:
  347. //-----------------------------------------------------------------------------
  348. void CBaseTeamObjectiveResource::SetOwningTeam( int index, int team )
  349. {
  350. AssertValidIndex(index);
  351. m_iOwner.Set( index, team );
  352. // clear the capper
  353. m_iCappingTeam.Set( index, TEAM_UNASSIGNED );
  354. UpdateCapHudElement();
  355. }
  356. //-----------------------------------------------------------------------------
  357. // Purpose:
  358. //-----------------------------------------------------------------------------
  359. void CBaseTeamObjectiveResource::SetCappingTeam( int index, int team )
  360. {
  361. AssertValidIndex(index);
  362. if ( m_iCappingTeam.Get( index ) != team )
  363. {
  364. m_iCappingTeam.Set( index, team );
  365. UpdateCapHudElement();
  366. }
  367. }
  368. //-----------------------------------------------------------------------------
  369. // Purpose:
  370. //-----------------------------------------------------------------------------
  371. void CBaseTeamObjectiveResource::SetTeamInZone( int index, int team )
  372. {
  373. AssertValidIndex(index);
  374. if ( m_iTeamInZone.Get( index ) != team )
  375. {
  376. m_iTeamInZone.Set( index, team );
  377. UpdateCapHudElement();
  378. }
  379. }
  380. //-----------------------------------------------------------------------------
  381. // Purpose:
  382. //-----------------------------------------------------------------------------
  383. void CBaseTeamObjectiveResource::SetCapBlocked( int index, bool bBlocked )
  384. {
  385. AssertValidIndex(index);
  386. if ( m_bBlocked.Get( index ) != bBlocked )
  387. {
  388. m_bBlocked.Set( index, bBlocked );
  389. UpdateCapHudElement();
  390. }
  391. }
  392. //-----------------------------------------------------------------------------
  393. // Purpose:
  394. //-----------------------------------------------------------------------------
  395. int CBaseTeamObjectiveResource::GetOwningTeam( int index )
  396. {
  397. if ( index >= m_iNumControlPoints )
  398. return TEAM_UNASSIGNED;
  399. return m_iOwner[index];
  400. }
  401. //-----------------------------------------------------------------------------
  402. // Purpose:
  403. //-----------------------------------------------------------------------------
  404. void CBaseTeamObjectiveResource::UpdateCapHudElement( void )
  405. {
  406. m_iUpdateCapHudParity = (m_iUpdateCapHudParity + 1) & CAPHUD_PARITY_MASK;
  407. }
  408. //-----------------------------------------------------------------------------
  409. // Purpose:
  410. //-----------------------------------------------------------------------------
  411. void CBaseTeamObjectiveResource::SetTrainPathDistance( int index, float flDistance )
  412. {
  413. AssertValidIndex(index);
  414. m_flPathDistance.Set( index, flDistance );
  415. }