Skip to content

Commit 3ade451

Browse files
committed
fix issues with stunned movement
fix net graph lerp color
1 parent 43fea37 commit 3ade451

File tree

4 files changed

+45
-13
lines changed

4 files changed

+45
-13
lines changed

game/client/vgui_netgraphpanel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ void CNetGraphPanel::DrawTextFields( int graphvalue, int x, int y, int w, netban
782782
interpcolor[ 2 ] = 31;
783783
}
784784
// flInterp is below recommended setting!!!
785-
else if ( flInterp < ( 2.0f / cl_updateinterval->GetFloat() ) )
785+
else if ( flInterp < ( 2.0f * cl_updateinterval->GetFloat() ) )
786786
{
787787
interpcolor[ 0 ] = 255;
788788
interpcolor[ 1 ] = 125;

game/server/tf/tf_player.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19405,6 +19405,17 @@ void IgnitePlayer()
1940519405
}
1940619406
static ConCommand cc_IgnitePlayer( "tf_ignite_player", IgnitePlayer, "Sets you on fire", FCVAR_CHEAT | FCVAR_DEVELOPMENTONLY );
1940719407

19408+
//-----------------------------------------------------------------------------
19409+
// Purpose: Debug concommand to stun the player
19410+
//-----------------------------------------------------------------------------
19411+
void StunPlayer()
19412+
{
19413+
CTFPlayer* pPlayer = ToTFPlayer(ToTFPlayer(UTIL_PlayerByIndex(1)));
19414+
float flStunAmount = 0.60f;
19415+
pPlayer->m_Shared.StunPlayer(10.0f, flStunAmount, TF_STUN_MOVEMENT, pPlayer);
19416+
}
19417+
static ConCommand cc_StunPlayer("tf_stun_player", StunPlayer, "Stuns you.", FCVAR_CHEAT | FCVAR_DEVELOPMENTONLY);
19418+
1940819419
//-----------------------------------------------------------------------------
1940919420
// Purpose:
1941019421
//-----------------------------------------------------------------------------

game/shared/gamemovement.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1020,7 +1020,7 @@ void CGameMovement::CheckParameters( void )
10201020
// Same thing but only do the sqrt if we have to.
10211021
if ( ( spd != 0.0 ) && ( spd > mv->m_flMaxSpeed*mv->m_flMaxSpeed ) )
10221022
{
1023-
float fRatio = mv->m_flMaxSpeed / sqrt( spd );
1023+
float fRatio = mv->m_flMaxSpeed / sqrtf( spd );
10241024
mv->m_flForwardMove *= fRatio;
10251025
mv->m_flSideMove *= fRatio;
10261026
mv->m_flUpMove *= fRatio;
@@ -4550,7 +4550,9 @@ void CGameMovement::PlayerMove( void )
45504550
{
45514551
VPROF( "CGameMovement::PlayerMove" );
45524552

4553+
#if !defined(TF_DLL) && !defined(TF_CLIENT_DLL)
45534554
CheckParameters();
4555+
#endif
45544556

45554557
// clear output applied velocity
45564558
mv->m_outWishVel.Init();

game/shared/tf/tf_gamemovement.cpp

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040

4141
ConVar tf_duck_debug_spew( "tf_duck_debug_spew", "0", FCVAR_REPLICATED | FCVAR_DEVELOPMENTONLY );
42-
ConVar tf_showspeed( "tf_showspeed", "0", FCVAR_REPLICATED | FCVAR_DEVELOPMENTONLY );
42+
ConVar tf_showspeed( "tf_showspeed", "0", FCVAR_REPLICATED | FCVAR_DEVELOPMENTONLY | FCVAR_CHEAT );
4343
ConVar tf_avoidteammates( "tf_avoidteammates", "1", FCVAR_REPLICATED | FCVAR_CHEAT | FCVAR_DEVELOPMENTONLY, "Controls how teammates interact when colliding.\n 0: Teammates block each other\n 1: Teammates pass through each other, but push each other away (default)" );
4444
ConVar tf_avoidteammates_pushaway( "tf_avoidteammates_pushaway", "1", FCVAR_REPLICATED, "Whether or not teammates push each other away when occupying the same space" );
4545
ConVar tf_solidobjects( "tf_solidobjects", "1", FCVAR_REPLICATED | FCVAR_CHEAT | FCVAR_DEVELOPMENTONLY );
@@ -317,6 +317,11 @@ void CTFGameMovement::ProcessMovement( CBasePlayer *pBasePlayer, CMoveData *pMov
317317
// Handle charging demomens
318318
ChargeMove();
319319

320+
// Handle scouts that can move really fast with buffs
321+
HighMaxSpeedMove();
322+
323+
CheckParameters();
324+
320325
// Handle player stun.
321326
StunMove();
322327

@@ -326,9 +331,6 @@ void CTFGameMovement::ProcessMovement( CBasePlayer *pBasePlayer, CMoveData *pMov
326331
// Handle grappling hook move
327332
GrapplingHookMove();
328333

329-
// Handle scouts that can move really fast with buffs
330-
HighMaxSpeedMove();
331-
332334
// Run the command.
333335
PlayerMove();
334336

@@ -580,7 +582,7 @@ bool CTFGameMovement::StunMove()
580582
if ( m_pTFPlayer->m_Shared.GetStunFlags() & TF_STUN_MOVEMENT_FORWARD_ONLY )
581583
{
582584
mv->m_flForwardMove = 0.f;
583-
}
585+
}
584586

585587
return true;
586588
}
@@ -1757,7 +1759,7 @@ void CTFGameMovement::WalkMove( void )
17571759
// Copy movement amounts
17581760
float flForwardMove = mv->m_flForwardMove;
17591761
float flSideMove = mv->m_flSideMove;
1760-
1762+
17611763
// Find the direction,velocity in the x,y plane.
17621764
Vector vecWishDirection( ( ( vecForward.x * flForwardMove ) + ( vecRight.x * flSideMove ) ),
17631765
( ( vecForward.y * flForwardMove ) + ( vecRight.y * flSideMove ) ),
@@ -1881,7 +1883,8 @@ void CTFGameMovement::WalkMove( void )
18811883
{
18821884
// Made it to the destination (remove the base velocity).
18831885
mv->SetAbsOrigin( trace.endpos );
1884-
VectorSubtract( mv->m_vecVelocity, player->GetBaseVelocity(), mv->m_vecVelocity );
1886+
Vector baseVelocity = player->GetBaseVelocity();
1887+
VectorSubtract( mv->m_vecVelocity, baseVelocity, mv->m_vecVelocity );
18851888

18861889
// Save the wish velocity.
18871890
mv->m_outWishVel += ( vecWishDirection * flWishSpeed );
@@ -1890,6 +1893,23 @@ void CTFGameMovement::WalkMove( void )
18901893
// NOTE YWB 7/5/07: Don't do this here, our version of CategorizePosition encompasses this test
18911894
// StayOnGround();
18921895

1896+
#if 1
1897+
// Debugging!!!
1898+
Vector vecTestVelocity = mv->m_vecVelocity;
1899+
vecTestVelocity.z = 0.0f;
1900+
float flTestSpeed = VectorLength(vecTestVelocity);
1901+
if (tf_showspeed.GetInt() == 2 && baseVelocity.IsZero() && (flTestSpeed > ( mv->m_flMaxSpeed + 1.0f )))
1902+
{
1903+
Msg("Step Max Speed < %f\n", flTestSpeed);
1904+
}
1905+
1906+
if (tf_showspeed.GetInt() == 2)
1907+
{
1908+
Msg("Speed=%f\n", flTestSpeed);
1909+
}
1910+
1911+
#endif
1912+
18931913
#ifdef CLIENT_DLL
18941914
// Track how far we moved (if we're a Scout or an Engineer carrying a building).
18951915
CTFPlayer* pTFPlayer = ToTFPlayer( player );
@@ -1928,21 +1948,20 @@ void CTFGameMovement::WalkMove( void )
19281948
// NOTE YWB 7/5/07: Don't do this here, our version of CategorizePosition encompasses this test
19291949
// StayOnGround();
19301950

1931-
#if 0
1951+
#if 1
19321952
// Debugging!!!
19331953
Vector vecTestVelocity = mv->m_vecVelocity;
19341954
vecTestVelocity.z = 0.0f;
19351955
float flTestSpeed = VectorLength( vecTestVelocity );
1936-
if ( baseVelocity.IsZero() && ( flTestSpeed > ( mv->m_flMaxSpeed + 1.0f ) ) )
1956+
if ( tf_showspeed.GetInt() == 1 && baseVelocity.IsZero() && ( flTestSpeed > ( mv->m_flMaxSpeed + 1.0f ) ) )
19371957
{
19381958
Msg( "Step Max Speed < %f\n", flTestSpeed );
19391959
}
19401960

1941-
if ( tf_showspeed.GetBool() )
1961+
if ( tf_showspeed.GetInt() == 1 )
19421962
{
19431963
Msg( "Speed=%f\n", flTestSpeed );
19441964
}
1945-
19461965
#endif
19471966
}
19481967

0 commit comments

Comments
 (0)