Skip to content

Commit b02efa7

Browse files
committed
Merge remote-tracking branch 'ValveSoftware/master' into mapbase-mp-2025
2 parents 048c72d + 88fa198 commit b02efa7

118 files changed

Lines changed: 1214 additions & 490 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

game/mod_tf/gameinfo.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,16 @@
3232
// folder.
3333
//
3434
// Note that this folder is scanned only when the game is booted.
35-
game+mod mod_tf/custom/*
35+
game+mod+custom_mod mod_tf/custom/*
3636
// Enable this if you want to load your TF custom content.
37-
//game+mod |appid_440|tf/custom/*
37+
//game+mod+custom_mod |appid_440|tf/custom/*
3838

3939
// Now search loose files. We'll set the directory containing the gameinfo.txt file
4040
// as the first "mod" search path (after any user customizations). This is also the one
4141
// that's used when writing to the "mod" path.
4242
mod+mod_write |gameinfo_path|.
4343
game+game_write |gameinfo_path|.
44+
vgui |gameinfo_path|.
4445
default_write_path |gameinfo_path|.
4546
gamebin |gameinfo_path|bin
4647

src/common/ServerBrowser/blacklisted_server_manager.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ void CBlacklistedServerManager::Reset( void )
4343
//-----------------------------------------------------------------------------
4444
int CBlacklistedServerManager::LoadServersFromFile( const char *pszFilename, bool bResetTimes )
4545
{
46-
KeyValues *pKV = new KeyValues( "serverblacklist" );
46+
KeyValuesAD pKV( "serverblacklist" );
4747
if ( !pKV->LoadFromFile( g_pFullFileSystem, pszFilename, "MOD" ) )
4848
return 0;
4949

@@ -75,8 +75,6 @@ int CBlacklistedServerManager::LoadServersFromFile( const char *pszFilename, boo
7575
}
7676
}
7777

78-
pKV->deleteThis();
79-
8078
return count;
8179
}
8280

src/game/client/c_baseentity.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,7 @@ BEGIN_RECV_TABLE_NOBASE(C_BaseEntity, DT_BaseEntity)
614614
#endif
615615
RecvPropInt(RECVINFO(m_iTeamNum)),
616616
RecvPropInt(RECVINFO(m_CollisionGroup)),
617+
RecvPropFloat(RECVINFO(m_flGravity)),
617618
RecvPropFloat(RECVINFO(m_flElasticity)),
618619
RecvPropFloat(RECVINFO(m_flShadowCastDistance)),
619620
RecvPropEHandle( RECVINFO(m_hOwnerEntity) ),
@@ -698,7 +699,7 @@ BEGIN_PREDICTION_DATA_NO_BASE( C_BaseEntity )
698699
// DEFINE_FIELD( m_flLastMessageTime, FIELD_FLOAT ),
699700
DEFINE_FIELD( m_vecBaseVelocity, FIELD_VECTOR ),
700701
DEFINE_FIELD( m_iEFlags, FIELD_INTEGER ),
701-
DEFINE_FIELD( m_flGravity, FIELD_FLOAT ),
702+
DEFINE_PRED_FIELD( m_flGravity, FIELD_FLOAT, FTYPEDESC_INSENDTABLE | FTYPEDESC_NOERRORCHECK ),
702703
// DEFINE_FIELD( m_ModelInstance, FIELD_SHORT ),
703704
DEFINE_FIELD( m_flProxyRandomValue, FIELD_FLOAT ),
704705

src/game/client/c_baseplayer.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,9 @@ LINK_ENTITY_TO_CLASS( player, C_BasePlayer );
476476
C_BasePlayer::C_BasePlayer() : m_iv_vecViewOffset( "C_BasePlayer::m_iv_vecViewOffset" )
477477
{
478478
AddVar( &m_vecViewOffset, &m_iv_vecViewOffset, LATCH_SIMULATION_VAR );
479+
480+
AddVar( &m_Local.m_vecPunchAngle, &m_Local.m_iv_vecPunchAngle, LATCH_SIMULATION_VAR );
481+
AddVar( &m_Local.m_vecPunchAngleVel, &m_Local.m_iv_vecPunchAngleVel, LATCH_SIMULATION_VAR );
479482

480483
#ifdef _DEBUG
481484
m_vecLadderNormal.Init();

src/game/client/c_baseviewmodel.cpp

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <KeyValues.h>
2020
#include "hltvcamera.h"
2121
#ifdef TF_CLIENT_DLL
22+
#include "c_tf_player.h"
2223
#include "tf_weaponbase.h"
2324
#endif
2425

@@ -91,6 +92,22 @@ void FormatViewModelAttachment( Vector &vOrigin, bool bInverse )
9192
vOrigin = pViewSetup->origin + vOut;
9293
}
9394

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

95112
void C_BaseViewModel::FormatViewModelAttachment( int nAttachment, matrix3x4_t &attachmentToWorld )
96113
{
@@ -211,7 +228,7 @@ bool C_BaseViewModel::ShouldFlipViewModel()
211228
CBaseCombatWeapon *pWeapon = m_hWeapon.Get();
212229
if ( pWeapon )
213230
{
214-
return pWeapon->m_bFlipViewModel != cl_flipviewmodels.GetBool();
231+
return pWeapon->m_bFlipViewModel != TeamFortress_ShouldFlipClientViewModel();
215232
}
216233
#endif
217234

src/game/client/c_baseviewmodel.h

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

19+
#ifdef TF_CLIENT_DLL
20+
bool TeamFortress_ShouldFlipClientViewModel( void );
21+
#endif //TF_CLIENT_DLL
22+
1923
#endif // C_BASEVIEWMODEL_H

src/game/client/econ/base_loadout_panel.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "vgui_controls/ComboBox.h"
2020
#include "vgui/IInput.h"
2121
#include "econ_ui.h"
22+
#include "c_tf_player.h"
2223

2324
// memdbgon must be the last include file in a .cpp file!!!
2425
#include <tier0/memdbgon.h>
@@ -265,8 +266,9 @@ void CBaseLoadoutPanel::ShowPanel( int iClass, bool bBackpack, bool bReturningFr
265266
UpdateModelPanels();
266267

267268
// make the first slot be selected so controller input will work
268-
static ConVarRef joystick( "joystick" );
269-
if( joystick.IsValid() && joystick.GetBool() && m_pItemModelPanels.Count() && m_pItemModelPanels[0] )
269+
//static ConVarRef joystick( "joystick" );
270+
bool bSteamController = ::input->IsSteamControllerActive();
271+
if( bSteamController && m_pItemModelPanels.Count() && m_pItemModelPanels[0] )
270272
{
271273
m_pItemModelPanels[0]->SetSelected( true );
272274
m_pItemModelPanels[0]->RequestFocus();
@@ -678,6 +680,7 @@ bool CBaseLoadoutPanel::HandleItemSelectionKeyPressed( vgui::KeyCode code )
678680
if ( nButtonCode == KEY_XBUTTON_UP ||
679681
nButtonCode == KEY_XSTICK1_UP ||
680682
nButtonCode == KEY_XSTICK2_UP ||
683+
nButtonCode == STEAMCONTROLLER_DPAD_UP ||
681684
nButtonCode == KEY_UP )
682685
{
683686
SelectAdjacentItem( 0, -1 );
@@ -730,7 +733,7 @@ bool CBaseLoadoutPanel::HandleItemSelectionKeyPressed( vgui::KeyCode code )
730733
}
731734
return true;
732735
}
733-
else if ( nButtonCode == KEY_XBUTTON_Y )
736+
else if ( nButtonCode == KEY_XBUTTON_Y || nButtonCode == STEAMCONTROLLER_Y )
734737
{
735738
m_bTooltipKeyPressed = true;
736739
CItemModelPanel *pSelection = GetFirstSelectedItemModelPanel( false );
@@ -754,7 +757,7 @@ bool CBaseLoadoutPanel::HandleItemSelectionKeyPressed( vgui::KeyCode code )
754757
bool CBaseLoadoutPanel::HandleItemSelectionKeyReleased( vgui::KeyCode code )
755758
{
756759
ButtonCode_t nButtonCode = GetBaseButtonCode( code );
757-
if( nButtonCode == KEY_XBUTTON_Y )
760+
if( nButtonCode == KEY_XBUTTON_Y || nButtonCode == STEAMCONTROLLER_Y )
758761
{
759762
m_bTooltipKeyPressed = false;
760763
m_pMouseOverTooltip->HideTooltip();

src/game/client/econ/econ_controls.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1910,14 +1910,15 @@ void CExplanationPopup::OnKeyCodePressed( vgui::KeyCode code )
19101910
ButtonCode_t nButtonCode = GetBaseButtonCode( code );
19111911

19121912
// swallow all keys
1913-
if ( nButtonCode == KEY_XBUTTON_B )
1913+
if ( nButtonCode == KEY_XBUTTON_B || nButtonCode == STEAMCONTROLLER_B )
19141914
{
19151915
OnCommand( "close" );
19161916
return;
19171917
}
19181918
else if ( nButtonCode == KEY_XBUTTON_LEFT ||
19191919
nButtonCode == KEY_XSTICK1_LEFT ||
19201920
nButtonCode == KEY_XSTICK2_LEFT ||
1921+
nButtonCode == STEAMCONTROLLER_DPAD_LEFT ||
19211922
code == KEY_LEFT )
19221923
{
19231924
OnCommand( "prevexplanation" );
@@ -1926,6 +1927,7 @@ void CExplanationPopup::OnKeyCodePressed( vgui::KeyCode code )
19261927
else if ( nButtonCode == KEY_XBUTTON_RIGHT ||
19271928
nButtonCode == KEY_XSTICK1_RIGHT ||
19281929
nButtonCode == KEY_XSTICK2_RIGHT ||
1930+
nButtonCode == STEAMCONTROLLER_DPAD_RIGHT ||
19291931
code == KEY_RIGHT )
19301932
{
19311933
OnCommand( "nextexplanation" );

src/game/client/econ/item_pickup_panel.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,13 +473,15 @@ void CItemPickupPanel::OnKeyCodePressed( vgui::KeyCode code )
473473
else if ( nButtonCode == KEY_XBUTTON_RIGHT ||
474474
nButtonCode == KEY_XSTICK1_RIGHT ||
475475
nButtonCode == KEY_XSTICK2_RIGHT ||
476+
nButtonCode == STEAMCONTROLLER_DPAD_RIGHT ||
476477
nButtonCode == KEY_RIGHT )
477478
{
478479
OnCommand( "nextitem" );
479480
}
480481
else if ( nButtonCode == KEY_XBUTTON_LEFT ||
481482
nButtonCode == KEY_XSTICK1_LEFT ||
482483
nButtonCode == KEY_XSTICK2_LEFT ||
484+
nButtonCode == STEAMCONTROLLER_DPAD_LEFT ||
483485
nButtonCode == KEY_LEFT )
484486
{
485487
OnCommand( "previtem" );
@@ -848,7 +850,7 @@ void CItemDiscardPanel::OnKeyCodePressed( vgui::KeyCode code )
848850
{
849851
ButtonCode_t nButtonCode = GetBaseButtonCode( code );
850852

851-
if( nButtonCode == KEY_XBUTTON_B )
853+
if( nButtonCode == KEY_XBUTTON_B || nButtonCode == STEAMCONTROLLER_B )
852854
{
853855
OnCommand( "vguicancel" );
854856
}

src/game/client/econ/item_selection_panel.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -378,9 +378,10 @@ void CItemSelectionPanel::OnKeyCodePressed( vgui::KeyCode code )
378378
NotifySelectionReturned( pItemPanel );
379379
}
380380
}
381-
else if( nButtonCode == KEY_XBUTTON_B )
381+
else if( nButtonCode == KEY_XBUTTON_B || nButtonCode == STEAMCONTROLLER_B )
382382
{
383-
PostMessageSelectionReturned( INVALID_ITEM_ID );
383+
//match the same behaviour as pressing ESC
384+
PostMessageSelectionReturned( 0 );
384385
OnClose();
385386
}
386387
else
@@ -1085,8 +1086,9 @@ void CEquipSlotItemSelectionPanel::UpdateModelPanelsForSelection( void )
10851086
int nPageStart = GetCurrentPage() * GetNumSlotsPerPage();
10861087
nOldSelection += nPageStart;
10871088

1088-
static ConVarRef joystick( "joystick" );
1089-
if ( joystick.IsValid() && joystick.GetBool() )
1089+
//static ConVarRef joystick( "joystick" );
1090+
bool bSteamController = ::input->IsSteamControllerActive();
1091+
if ( bSteamController )
10901092
{
10911093
if( nOldSelection == -1 || nOldSelection >= vecDisplayItems.Count() )
10921094
nOldSelection = nPageStart;
@@ -1102,7 +1104,7 @@ void CEquipSlotItemSelectionPanel::UpdateModelPanelsForSelection( void )
11021104
m_pItemModelPanels[i]->SetShowGreyedOutTooltip( true );
11031105
m_pItemModelPanels[i]->SetGreyedOut( NULL );
11041106
m_pItemModelPanels[i]->SetNoItemText( "#SelectNoItemSlot" );
1105-
bool bSelected = joystick.IsValid() && joystick.GetBool() && iItemIndex == nOldSelection;
1107+
bool bSelected = bSteamController && iItemIndex == nOldSelection;
11061108
m_pItemModelPanels[i]->SetSelected( bSelected );
11071109
m_pItemModelPanels[i]->SetShowQuantity( true );
11081110
m_pItemModelPanels[i]->SetForceShowEquipped( false );

0 commit comments

Comments
 (0)