aboutsummaryrefslogtreecommitdiff
path: root/mp/src/game/server/team_control_point.cpp
diff options
context:
space:
mode:
authorJohn Schoenick <[email protected]>2015-09-09 18:35:41 -0700
committerJohn Schoenick <[email protected]>2015-09-09 18:35:41 -0700
commit0d8dceea4310fde5706b3ce1c70609d72a38efdf (patch)
treec831ef32c2c801a5c5a80401736b52c7b5a528ec /mp/src/game/server/team_control_point.cpp
parentUpdated the SDK with the latest code from the TF and HL2 branches. (diff)
downloadsource-sdk-2013-master.tar.xz
source-sdk-2013-master.zip
Updated the SDK with the latest code from the TF and HL2 branches.HEADmaster
Diffstat (limited to 'mp/src/game/server/team_control_point.cpp')
-rw-r--r--mp/src/game/server/team_control_point.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/mp/src/game/server/team_control_point.cpp b/mp/src/game/server/team_control_point.cpp
index 1bbec70a..a1288ad7 100644
--- a/mp/src/game/server/team_control_point.cpp
+++ b/mp/src/game/server/team_control_point.cpp
@@ -17,6 +17,7 @@
#ifdef TF_DLL
#include "tf_shareddefs.h"
+#include "tf_gamerules.h"
#endif
#define CONTROL_POINT_UNLOCK_THINK "UnlockThink"
@@ -269,6 +270,7 @@ void CTeamControlPoint::Precache( void )
#ifdef TF_DLL
PrecacheScriptSound( "Announcer.ControlPointContested" );
+ PrecacheScriptSound( "Announcer.ControlPointContested_Neutral" );
#endif
}
@@ -653,7 +655,15 @@ void CTeamControlPoint::InternalSetOwner( int iCapTeam, bool bMakeSound, int iNu
Assert( playerIndex > 0 && playerIndex <= gpGlobals->maxClients );
- PlayerCapped( ToBaseMultiplayerPlayer(UTIL_PlayerByIndex( playerIndex )) );
+ CBaseMultiplayerPlayer *pPlayer = ToBaseMultiplayerPlayer( UTIL_PlayerByIndex( playerIndex ) );
+ PlayerCapped( pPlayer );
+
+#ifdef TF_DLL
+ if ( TFGameRules() && TFGameRules()->IsHolidayActive( kHoliday_EOTL ) )
+ {
+ TFGameRules()->DropBonusDuck( pPlayer->GetAbsOrigin(), ToTFPlayer( pPlayer ), NULL, NULL, false, true );
+ }
+#endif
}
// Remap team to get first game team = 1
@@ -733,7 +743,7 @@ void CTeamControlPoint::SendCapString( int iCapTeam, int iNumCappingPlayers, int
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
-void CTeamControlPoint::CaptureBlocked( CBaseMultiplayerPlayer *pPlayer )
+void CTeamControlPoint::CaptureBlocked( CBaseMultiplayerPlayer *pPlayer, CBaseMultiplayerPlayer *pVictim )
{
if( strlen( STRING(m_iszPrintName) ) <= 0 )
return;
@@ -746,6 +756,10 @@ void CTeamControlPoint::CaptureBlocked( CBaseMultiplayerPlayer *pPlayer )
event->SetString( "cpname", STRING(m_iszPrintName) );
event->SetInt( "blocker", pPlayer->entindex() );
event->SetInt( "priority", 9 );
+ if ( pVictim )
+ {
+ event->SetInt( "victim", pVictim->entindex() );
+ }
gameeventmanager->FireEvent( event );
}