Skip to content

Commit 1d7f58b

Browse files
committed
1 parent 5e8fa0f commit 1d7f58b

File tree

8 files changed

+247
-43
lines changed

8 files changed

+247
-43
lines changed

src/game/client/tf/c_tf_player.cpp

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5845,6 +5845,9 @@ void C_TFPlayer::HandleTaunting( void )
58455845
// Clear the taunt slot.
58465846
if ( !m_bWasTaunting &&
58475847
(
5848+
#ifdef BDSBASE
5849+
IsInCYOAPDAAnimation() ||
5850+
#endif
58485851
m_Shared.InCond( TF_COND_TAUNTING ) ||
58495852
m_Shared.IsControlStunned() ||
58505853
m_Shared.IsLoser() ||
@@ -5872,7 +5875,11 @@ void C_TFPlayer::HandleTaunting( void )
58725875

58735876
if ( ( !IsAlive() && m_nForceTauntCam < 2 ) ||
58745877
(
5875-
m_bWasTaunting && !m_Shared.InCond( TF_COND_TAUNTING ) && !m_Shared.IsControlStunned() &&
5878+
#ifdef BDSBASE
5879+
m_bWasTaunting && !IsInCYOAPDAAnimation() && !m_Shared.InCond(TF_COND_TAUNTING) && !m_Shared.IsControlStunned() &&
5880+
#else
5881+
m_bWasTaunting && !m_Shared.InCond(TF_COND_TAUNTING) && !m_Shared.IsControlStunned() &&
5882+
#endif
58765883
!m_Shared.InCond( TF_COND_PHASE ) && !m_Shared.IsLoser() && !m_bIsReadyToHighFive &&
58775884
!m_nForceTauntCam && !m_Shared.InCond( TF_COND_HALLOWEEN_BOMB_HEAD ) &&
58785885
!m_Shared.InCond( TF_COND_HALLOWEEN_THRILLER ) &&
@@ -6773,6 +6780,17 @@ bool C_TFPlayer::CreateMove( float flInputSampleTime, CUserCmd *pCmd )
67736780
{
67746781
m_Shared.CreateVehicleMove( flInputSampleTime, pCmd );
67756782
}
6783+
#ifdef BDSBASE
6784+
else if (IsInCYOAPDAAnimation())
6785+
{
6786+
// Not allowed to move while the ConTracker is open.
6787+
pCmd->forwardmove = 0.0f;
6788+
pCmd->sidemove = 0.0f;
6789+
pCmd->upmove = 0.0f;
6790+
6791+
pCmd->weaponselect = 0;
6792+
}
6793+
#endif
67766794
else if ( bInTaunt )
67776795
{
67786796
if ( tf_allow_taunt_switch.GetInt() <= 1 )
@@ -6958,6 +6976,11 @@ void C_TFPlayer::CleanUpAnimationOnSpawn()
69586976
{
69596977
m_PlayerAnimState->ClearAnimationState();
69606978
}
6979+
6980+
#ifdef BDSBASE
6981+
// Close the ConTracker
6982+
StopViewingCYOAPDA();
6983+
#endif
69616984
}
69626985

69636986

src/game/client/tf/c_tf_player.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,10 @@ class C_TFPlayer : public C_BasePlayer, public IHasAttributes, public IInventory
197197
bool IsTaunting( void ) const { return m_Shared.InCond( TF_COND_TAUNTING ); }
198198

199199
bool IsViewingCYOAPDA( void ) const { return m_bViewingCYOAPDA; }
200+
#ifdef BDSBASE
201+
bool IsInCYOAPDAAnimation(void) const;
202+
void StopViewingCYOAPDA(void);
203+
#endif
200204
bool IsRegenerating( void ) const { return m_bRegenerating; }
201205

202206
virtual void InitPhonemeMappings();
@@ -257,7 +261,12 @@ class C_TFPlayer : public C_BasePlayer, public IHasAttributes, public IInventory
257261
void StopKartBrakeEffect();
258262
CNetworkVar( int, m_iKartState );
259263

260-
bool IsAllowedToTaunt( void );
264+
#ifdef BDSBASE
265+
bool IsAllowedToTaunt(bool bHoldingCYOAPDA = false);
266+
bool IsAllowedToViewCYOAPDA(void);
267+
#else
268+
bool IsAllowedToTaunt(void);
269+
#endif
261270

262271
virtual bool IsOverridingViewmodel( void );
263272
virtual int DrawOverriddenViewmodel( C_BaseViewModel *pViewmodel, int flags );

src/game/client/tf/vgui/tf_quest_map_panel.cpp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,16 +1245,22 @@ CON_COMMAND( show_quest_log, "Show the quest map panel" )
12451245
}
12461246
else
12471247
{
1248-
CTFPlayer *pTFLocalPlayer = CTFPlayer::GetLocalTFPlayer();
1249-
if ( pTFLocalPlayer && ( pTFLocalPlayer->IsTaunting() || pTFLocalPlayer->ShouldShowHudMenuTauntSelection() ) )
1248+
#ifdef BDSBASE
1249+
engine->ClientCmd_Unrestricted("gameui_activate");
1250+
GetQuestMapPanel()->SetVisible(true);
1251+
GetQuestMapPanel()->GoToCurrentQuest();
1252+
#else
1253+
CTFPlayer* pTFLocalPlayer = CTFPlayer::GetLocalTFPlayer();
1254+
if (pTFLocalPlayer && (pTFLocalPlayer->IsTaunting() || pTFLocalPlayer->ShouldShowHudMenuTauntSelection()))
12501255
{
1251-
internalCenterPrint->Print( "#TF_CYOA_PDA_Taunting" );
1256+
internalCenterPrint->Print("#TF_CYOA_PDA_Taunting");
12521257
}
12531258
else
12541259
{
1255-
engine->ClientCmd_Unrestricted( "gameui_activate" );
1256-
GetQuestMapPanel()->SetVisible( true );
1260+
engine->ClientCmd_Unrestricted("gameui_activate");
1261+
GetQuestMapPanel()->SetVisible(true);
12571262
GetQuestMapPanel()->GoToCurrentQuest();
12581263
}
1264+
#endif
12591265
}
12601266
}

src/game/server/tf/tf_player.cpp

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,14 @@ BEGIN_ENT_SCRIPTDESC( CTFPlayer, CBaseMultiplayerPlayer , "Team Fortress 2 Playe
610610
DEFINE_SCRIPTFUNC( SetUseBossHealthBar, "" )
611611
DEFINE_SCRIPTFUNC( IsFireproof, "" )
612612
DEFINE_SCRIPTFUNC( IsAllowedToTaunt, "" )
613-
DEFINE_SCRIPTFUNC( IsViewingCYOAPDA, "" )
613+
#ifdef BDSBASE
614+
DEFINE_SCRIPTFUNC(IsAllowedToViewCYOAPDA, "")
615+
DEFINE_SCRIPTFUNC(IsViewingCYOAPDA, "Returns true if this player has indicated that they are viewing the ConTracker")
616+
DEFINE_SCRIPTFUNC(IsInCYOAPDAAnimation, "Returns true if this player is viewing or playing any ConTracker animations")
617+
DEFINE_SCRIPTFUNC(StopViewingCYOAPDA, "Causes the player to immediately stop viewing the ConTracker")
618+
#else
619+
DEFINE_SCRIPTFUNC(IsViewingCYOAPDA, "")
620+
#endif
614621
DEFINE_SCRIPTFUNC( IsRegenerating, "" )
615622
DEFINE_SCRIPTFUNC( GetCurrentTauntMoveSpeed, "" )
616623
DEFINE_SCRIPTFUNC( SetCurrentTauntMoveSpeed, "" )
@@ -3318,6 +3325,16 @@ void CTFPlayer::PlayerRunCommand( CUserCmd *ucmd, IMoveHelper *moveHelper )
33183325
m_Shared.CreateVehicleMove( gpGlobals->frametime, ucmd );
33193326
}
33203327
#ifdef BDSBASE
3328+
else if (IsInCYOAPDAAnimation())
3329+
{
3330+
// Not allowed to move while the ConTracker is open.
3331+
ucmd->forwardmove = 0.0f;
3332+
ucmd->sidemove = 0.0f;
3333+
ucmd->upmove = 0.0f;
3334+
3335+
ucmd->viewangles = pl.v_angle;
3336+
ucmd->weaponselect = 0;
3337+
}
33213338
else if (IsTaunting())
33223339
#else
33233340
else if (IsTaunting() || m_Shared.InCond(TF_COND_HALLOWEEN_THRILLER))
@@ -8224,15 +8241,25 @@ bool CTFPlayer::ClientCommand( const CCommand &args )
82248241
{
82258242
bool bOpen = atoi( args[1] ) != 0;
82268243

8227-
if ( bOpen && IsTaunting() )
8244+
#ifdef BDSBASE
8245+
if (bOpen && !IsAllowedToViewCYOAPDA())
82288246
{
8229-
ClientPrint( this, HUD_PRINTCENTER, "#TF_CYOA_PDA_Taunting" );
8247+
bOpen = false;
8248+
}
8249+
8250+
m_bViewingCYOAPDA.Set(bOpen);
8251+
#else
8252+
if (bOpen && IsTaunting())
8253+
{
8254+
ClientPrint(this, HUD_PRINTCENTER, "#TF_CYOA_PDA_Taunting");
82308255
}
82318256
else
82328257
{
8233-
m_bViewingCYOAPDA.Set( bOpen );
8258+
m_bViewingCYOAPDA.Set(bOpen);
82348259
TeamFortress_SetSpeed();
82358260
}
8261+
#endif
8262+
82368263
return true;
82378264
}
82388265

src/game/server/tf/tf_player.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,12 @@ class CTFPlayer : public CBaseMultiplayerPlayer, public IHasAttributes, public I
774774
void ScriptTaunt( int iTauntIndex, int iTauntConcept ) { Taunt((taunts_t)iTauntIndex, iTauntConcept); }
775775
bool IsTaunting( void ) const { return m_Shared.InCond( TF_COND_TAUNTING ); }
776776
void DoTauntAttack( void );
777-
bool IsAllowedToTaunt( void );
777+
#ifdef BDSBASE
778+
bool IsAllowedToTaunt(bool bHoldingCYOAPDA = false);
779+
bool IsAllowedToViewCYOAPDA(void);
780+
#else
781+
bool IsAllowedToTaunt(void);
782+
#endif
778783
bool FindOpenTauntPartnerPosition( const CEconItemView *pEconItemView, Vector &position, float *flTolerance );
779784
bool IsAllowedToInitiateTauntWithPartner( const CEconItemView *pEconItemView, char *pszErrorMessage = NULL, int cubErrorMessage = 0 );
780785
void CancelTaunt( void );
@@ -801,6 +806,10 @@ class CTFPlayer : public CBaseMultiplayerPlayer, public IHasAttributes, public I
801806
void SetVehicleReverseTime( float flTime ) { m_flVehicleReverseTime = flTime; }
802807

803808
bool IsViewingCYOAPDA( void ) const { return m_bViewingCYOAPDA; }
809+
#ifdef BDSBASE
810+
bool IsInCYOAPDAAnimation(void) const;
811+
void StopViewingCYOAPDA(void);
812+
#endif
804813
bool IsRegenerating( void ) const { return m_bRegenerating; }
805814

806815
#ifndef BDSBASE

src/game/shared/tf/tf_gamemovement.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,11 @@ bool CTFGameMovement::StunMove()
649649
// No one can move when in a final countdown transition or with the ConTracker open.
650650
// Do this here to avoid the inevitable hack that prevents players
651651
// from receiving a flag or condition by stalling thinks, etc.
652-
if ( m_pTFPlayer->IsViewingCYOAPDA() || ( TFGameRules() && TFGameRules()->BInMatchStartCountdown() ) )
652+
#ifdef BDSBASE
653+
if (m_pTFPlayer->IsInCYOAPDAAnimation() || (TFGameRules() && TFGameRules()->BInMatchStartCountdown()))
654+
#else
655+
if (m_pTFPlayer->IsViewingCYOAPDA() || (TFGameRules() && TFGameRules()->BInMatchStartCountdown()))
656+
#endif
653657
{
654658
mv->m_flForwardMove = 0.f;
655659
mv->m_flSideMove = 0.f;

0 commit comments

Comments
 (0)