Skip to content

Commit 6a79e47

Browse files
committed
1 parent f257bd9 commit 6a79e47

File tree

10 files changed

+86
-1
lines changed

10 files changed

+86
-1
lines changed

game/quiver/info_changelog.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ Quiver Private Alpha 1.1.0 (WIP):
4242
- Added the following Source SDK Pull Requests:
4343
- #1437: MvM: Fix Explosive Headshot working on invulnerable target
4444
- #1440: Treat being in background map as not in-game
45-
-
45+
- #1439: Network player's handedness preference to spectators
46+
- #1444: Hide intel upgrade hud when no intel is enabled
4647

4748
Quiver Private Alpha 1.0.1:
4849
- Whitelisted the Back Scatter and Force-a-Nature.

src/game/client/c_baseviewmodel.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
#include <KeyValues.h>
2020
#include "hltvcamera.h"
2121
#ifdef TF_CLIENT_DLL
22+
#ifdef BDSBASE
23+
#include "c_tf_player.h"
24+
#endif
2225
#include "tf_weaponbase.h"
2326
#endif
2427

@@ -91,6 +94,24 @@ void FormatViewModelAttachment( Vector &vOrigin, bool bInverse )
9194
vOrigin = pViewSetup->origin + vOut;
9295
}
9396

97+
#ifdef BDSBASE
98+
#ifdef TF_CLIENT_DLL
99+
bool TeamFortress_ShouldFlipClientViewModel(void)
100+
{
101+
if (IsLocalPlayerSpectator())
102+
{
103+
// Use spectated client's handedness preference
104+
C_TFPlayer* pSpecTarget = ToTFPlayer(UTIL_PlayerByIndex(GetSpectatorTarget()));
105+
if (pSpecTarget)
106+
{
107+
return pSpecTarget->m_bFlipViewModels;
108+
}
109+
}
110+
111+
return cl_flipviewmodels.GetBool();
112+
}
113+
#endif //TF_CLIENT_DLL
114+
#endif
94115

95116
void C_BaseViewModel::FormatViewModelAttachment( int nAttachment, matrix3x4_t &attachmentToWorld )
96117
{
@@ -211,7 +232,11 @@ bool C_BaseViewModel::ShouldFlipViewModel()
211232
CBaseCombatWeapon *pWeapon = m_hWeapon.Get();
212233
if ( pWeapon )
213234
{
235+
#ifdef BDSBASE
236+
return pWeapon->m_bFlipViewModel != TeamFortress_ShouldFlipClientViewModel();
237+
#else
214238
return pWeapon->m_bFlipViewModel != cl_flipviewmodels.GetBool();
239+
#endif
215240
}
216241
#ifdef BDSBASE
217242
return cl_flipviewmodels.GetBool(); // hack for scout ball projeciles to have properly flipped viewmodels

src/game/client/c_baseviewmodel.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,10 @@
1616
#include "utlvector.h"
1717
#include "baseviewmodel_shared.h"
1818

19+
#ifdef BDSBASE
20+
#ifdef TF_CLIENT_DLL
21+
bool TeamFortress_ShouldFlipClientViewModel(void);
22+
#endif //TF_CLIENT_DLL
23+
#endif
24+
1925
#endif // C_BASEVIEWMODEL_H

src/game/client/tf/c_tf_player.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3945,6 +3945,9 @@ IMPLEMENT_CLIENTCLASS_DT( C_TFPlayer, DT_TFPlayer, CTFPlayer )
39453945
RecvPropFloat( RECVINFO( m_flMvMLastDamageTime ) ),
39463946
RecvPropFloat( RECVINFO_NAME( m_flMvMLastDamageTime, "m_flLastDamageTime" ) ), // Renamed
39473947
RecvPropInt( RECVINFO( m_iSpawnCounter ) ),
3948+
#ifdef BDSBASE
3949+
RecvPropBool(RECVINFO(m_bFlipViewModels)),
3950+
#endif
39483951
RecvPropBool( RECVINFO( m_bArenaSpectator ) ),
39493952

39503953
RecvPropDataTable( RECVINFO_DT( m_AttributeManager ), 0, &REFERENCE_RECV_TABLE(DT_AttributeManager) ),

src/game/client/tf/c_tf_player.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,10 @@ class C_TFPlayer : public C_BasePlayer, public IHasAttributes, public IInventory
702702
int m_iSpawnCounter;
703703
bool m_bArenaSpectator;
704704

705+
#ifdef BDSBASE
706+
bool m_bFlipViewModels;
707+
#endif
708+
705709
bool m_bIsMiniBoss;
706710
bool m_bIsABot;
707711
int m_nBotSkill;

src/game/client/tf/tf_hud_mann_vs_machine_status.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2222,7 +2222,24 @@ void CTFHudMannVsMachineStatus::ReopenVictoryPanel( void )
22222222
//-----------------------------------------------------------------------------
22232223
void CTFHudMannVsMachineStatus::UpdateBombCarrierProgress ( void )
22242224
{
2225+
#ifdef BDSBASE
2226+
bool bEnabledFlags = false;
2227+
2228+
for (int i = 0; i < ICaptureFlagAutoList::AutoList().Count(); ++i)
2229+
{
2230+
CCaptureFlag* pFlag = static_cast<CCaptureFlag*>(ICaptureFlagAutoList::AutoList()[i]);
2231+
2232+
if (pFlag && !pFlag->IsDisabled())
2233+
{
2234+
bEnabledFlags = true;
2235+
break;
2236+
}
2237+
}
2238+
2239+
m_pUpgradeLevelContainer->SetVisible(bEnabledFlags && (TFGameRules()->State_Get() == GR_STATE_RND_RUNNING));
2240+
#else
22252241
m_pUpgradeLevelContainer->SetVisible( TFGameRules()->State_Get() == GR_STATE_RND_RUNNING );
2242+
#endif
22262243

22272244
if ( !m_pUpgradeLevel1 || !m_pUpgradeLevel2 || !m_pUpgradeLevel3 || !m_pUpgradeLevelBoss )
22282245
return;

src/game/server/tf/tf_player.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,9 @@ IMPLEMENT_SERVERCLASS_ST( CTFPlayer, DT_TFPlayer )
881881

882882
SendPropFloat( SENDINFO( m_flMvMLastDamageTime ), 16, SPROP_ROUNDUP ),
883883
SendPropInt( SENDINFO( m_iSpawnCounter ) ),
884+
#ifdef BDSBASE
885+
SendPropBool(SENDINFO(m_bFlipViewModels)),
886+
#endif
884887
SendPropBool( SENDINFO( m_bArenaSpectator ) ),
885888
SendPropFloat( SENDINFO( m_flHeadScale ) ),
886889
SendPropFloat( SENDINFO( m_flTorsoScale ) ),

src/game/server/tf/tf_player.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,11 @@ class CTFPlayer : public CBaseMultiplayerPlayer, public IHasAttributes, public I
10551055
#endif
10561056
int m_iOldStunFlags;
10571057

1058+
#ifdef BDSBASE
1059+
CNetworkVar(bool, m_bFlipViewModels);
1060+
#else
10581061
bool m_bFlipViewModels;
1062+
#endif
10591063
int m_iBlastJumpState;
10601064
float m_flBlastJumpLandTime;
10611065
bool m_bTakenBlastDamageSinceLastMovement;

src/game/shared/econ/econ_entity.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
#include "cdll_util.h"
2020

2121
#if defined(TF_CLIENT_DLL)
22+
#ifdef BDSBASE
23+
#include "c_baseviewmodel.h"
24+
#endif
2225
#include "c_tf_player.h"
2326
#include "tf_gamerules.h"
2427
#include "c_playerresource.h"
@@ -91,9 +94,11 @@ BEGIN_ENT_SCRIPTDESC( CEconEntity, CBaseAnimating, "Econ Entity" )
9194
END_SCRIPTDESC();
9295
#endif
9396

97+
#ifndef BDSBASE
9498
#ifdef TF_CLIENT_DLL
9599
extern ConVar cl_flipviewmodels;
96100
#endif
101+
#endif
97102

98103

99104
#ifdef CLIENT_DLL
@@ -857,7 +862,11 @@ int C_ViewmodelAttachmentModel::InternalDrawModel( int flags )
857862
{
858863
#ifdef TF_CLIENT_DLL
859864
CMatRenderContextPtr pRenderContext( materials );
865+
#ifdef BDSBASE
866+
if (TeamFortress_ShouldFlipClientViewModel() != m_bAlwaysFlip)
867+
#else
860868
if ( cl_flipviewmodels.GetBool() != m_bAlwaysFlip )
869+
#endif
861870
{
862871
pRenderContext->CullMode( MATERIAL_CULLMODE_CW );
863872
}

src/game/shared/tf/tf_weaponbase.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@
4747
#include "tf_gamestats.h"
4848
// Client specific.
4949
#else
50+
#ifdef BDSBASE
51+
#include "c_baseviewmodel.h"
52+
#endif
5053
#include "c_tf_player.h"
5154
#include "tf_viewmodel.h"
5255
#include "hud_crosshair.h"
@@ -91,8 +94,10 @@ extern ConVar tf_weapon_criticals_bucket_bottom;
9194

9295
#ifdef CLIENT_DLL
9396
extern ConVar cl_crosshair_file;
97+
#ifndef BDSBASE
9498
extern ConVar cl_flipviewmodels;
9599
#endif
100+
#endif
96101

97102
//=============================================================================
98103
//
@@ -5859,8 +5864,12 @@ bool CTFWeaponBase::IsViewModelFlipped( void )
58595864
{
58605865
return true;
58615866
}
5867+
#else
5868+
#ifdef BDSBASE
5869+
if (m_bFlipViewModel != TeamFortress_ShouldFlipClientViewModel())
58625870
#else
58635871
if ( m_bFlipViewModel != cl_flipviewmodels.GetBool() )
5872+
#endif
58645873
{
58655874
return true;
58665875
}
@@ -7045,7 +7054,11 @@ void CTFWeaponBase::AddStatTrakModel( CEconItemView *pItem, int nStatTrakType, A
70457054
pStatTrakEnt->m_nSkin = nSkin;
70467055
m_viewmodelStatTrakAddon = pStatTrakEnt;
70477056

7057+
#ifdef BDSBASE
7058+
if (TeamFortress_ShouldFlipClientViewModel())
7059+
#else
70487060
if ( cl_flipviewmodels.GetBool() )
7061+
#endif
70497062
{
70507063
pStatTrakEnt->SetBodygroup( 1, 1 ); // use a special mirror-image stattrak module that appears correct for lefties
70517064
flScale *= -1.0f; // flip scale

0 commit comments

Comments
 (0)