From bcf509c5df1b5e2ac94157be04893c314a3fda32 Mon Sep 17 00:00:00 2001 From: Andreas Date: Wed, 28 Aug 2019 03:32:34 +0200 Subject: [PATCH 1/8] Fixed prediction errors https://steamcommunity.com/app/211/discussions/1/1743343017631727486/ --- mp/src/game/shared/gamemovement.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mp/src/game/shared/gamemovement.cpp b/mp/src/game/shared/gamemovement.cpp index 76e4f22f..fa88bfbf 100644 --- a/mp/src/game/shared/gamemovement.cpp +++ b/mp/src/game/shared/gamemovement.cpp @@ -62,7 +62,7 @@ ConVar debug_latch_reset_onduck( "debug_latch_reset_onduck", "1", FCVAR_CHEAT ); #endif // [MD] I'll remove this eventually. For now, I want the ability to A/B the optimizations. -bool g_bMovementOptimizations = true; +bool g_bMovementOptimizations = false; //switched to false to fix prediction errors // Roughly how often we want to update the info about the ground surface we're on. // We don't need to do this very often. From aedc714659e7f67106c855def2386e6c2c0f65ca Mon Sep 17 00:00:00 2001 From: Andreas Date: Fri, 24 Jan 2020 10:00:07 +0100 Subject: [PATCH 2/8] Update .gitignore --- .gitignore | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 7f39f931..fc213c9a 100644 --- a/.gitignore +++ b/.gitignore @@ -18,8 +18,13 @@ ipch *.opensdf *.idb *.vcxproj -#*.sln +*.sln +*.lib + +# Visual studio config dirs .vs/* +mp/src/.vs/* +sp/src/.vs/* # OSX/Linux build products *.mak @@ -102,9 +107,7 @@ sp/src/tier1/tier1.vpc.sentinel sp/src/vgui2/vgui_controls/vgui_controls.vcxproj.filters sp/src/vgui2/vgui_controls/vgui_controls.vcxproj.vpc_crc sp/src/vgui2/vgui_controls/vgui_controls.vpc.sentinel -*.lib -*.lib -*.lib + sp/src/lib/public/mathlib.lib sp/src/lib/public/raytrace.lib sp/src/lib/public/tier1.lib @@ -112,4 +115,18 @@ sp/src/lib/public/vgui_controls.lib #game directories sp/game/* -mp/game/* \ No newline at end of file +mp/game/* +*.vpc_crc +*.filters +mp/src/game/server/server_hl2mp.vpc.sentinel +mp/src/game/client/client_hl2mp.vpc.sentinel +mp/src/.vs/games/v16/Browse.VC.opendb +mp/src/.vs/* +mp/src/vgui2/vgui_controls/vgui_controls.vpc.sentinel +mp/src/tier1/tier1.vpc.sentinel +mp/src/raytrace/raytrace.vpc.sentinel +mp/src/mathlib/mathlib.vpc.sentinel +mp/src/lib/public/vgui_controls.lib +mp/src/lib/public/tier1.lib +mp/src/lib/public/raytrace.lib +mp/src/lib/public/mathlib.lib \ No newline at end of file From a6fb0e805d642ab60d59e287afbd3ccc29b7e516 Mon Sep 17 00:00:00 2001 From: Andreas Date: Sat, 25 Jan 2020 20:21:35 +0100 Subject: [PATCH 3/8] updated gitignore --- .gitignore | 50 +++++--------------------------------------------- 1 file changed, 5 insertions(+), 45 deletions(-) diff --git a/.gitignore b/.gitignore index 7f39f931..a319f178 100644 --- a/.gitignore +++ b/.gitignore @@ -59,56 +59,16 @@ sp/game/mod_hl2/cfg/server_blacklist.txt *.cache *.pdb *.db -sp/src/lib/public/mathlib.lib -sp/src/lib/public/raytrace.lib -sp/src/lib/public/tier1.lib -sp/src/lib/public/vgui_controls.lib -sp/src/lib/public/mathlib.lib -sp/src/lib/public/raytrace.lib -sp/src/lib/public/tier1.lib -sp/src/lib/public/vgui_controls.lib -.vs/slnx.sqlite -.vs/sourcearena/v16/Browse.VC.opendb -.vs/VSWorkspaceState.json sp/game/mod_hl2/GameState.txt sp/game/mod_hl2/maps/graphs/sdk_vehicles.ain sp/game/mod_hl2/stats.txt sp/game/mod_hl2/voice_ban.dt -sp/src/game/client/client_episodic.vcxproj.filters -sp/src/game/client/client_episodic.vcxproj.vpc_crc -sp/src/game/client/client_episodic.vpc.sentinel -sp/src/game/client/client_hl2.vcxproj.filters -sp/src/game/client/client_hl2.vcxproj.vpc_crc -sp/src/game/client/client_hl2.vpc.sentinel -sp/src/game/server/server_episodic.vcxproj.filters -sp/src/game/server/server_episodic.vcxproj.vpc_crc -sp/src/game/server/server_episodic.vpc.sentinel -sp/src/game/server/server_hl2.vcxproj.filters -sp/src/game/server/server_hl2.vcxproj.vpc_crc -sp/src/game/server/server_hl2.vpc.sentinel -sp/src/lib/public/mathlib.lib -sp/src/lib/public/raytrace.lib -sp/src/lib/public/tier1.lib -sp/src/lib/public/vgui_controls.lib -sp/src/mathlib/mathlib.vcxproj.filters -sp/src/mathlib/mathlib.vcxproj.vpc_crc -sp/src/mathlib/mathlib.vpc.sentinel -sp/src/raytrace/raytrace.vcxproj.filters -sp/src/raytrace/raytrace.vcxproj.vpc_crc -sp/src/raytrace/raytrace.vpc.sentinel -sp/src/tier1/tier1.vcxproj.filters -sp/src/tier1/tier1.vcxproj.vpc_crc -sp/src/tier1/tier1.vpc.sentinel -sp/src/vgui2/vgui_controls/vgui_controls.vcxproj.filters -sp/src/vgui2/vgui_controls/vgui_controls.vcxproj.vpc_crc -sp/src/vgui2/vgui_controls/vgui_controls.vpc.sentinel + + +*.vpc_crc +*.sentinel +*.filters *.lib -*.lib -*.lib -sp/src/lib/public/mathlib.lib -sp/src/lib/public/raytrace.lib -sp/src/lib/public/tier1.lib -sp/src/lib/public/vgui_controls.lib #game directories sp/game/* From 4dcea961892ed20ab2a79e5c93b6c0710e020d67 Mon Sep 17 00:00:00 2001 From: Andreas Date: Sat, 25 Jan 2020 20:22:03 +0100 Subject: [PATCH 4/8] updated gitignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index a319f178..687dfb18 100644 --- a/.gitignore +++ b/.gitignore @@ -18,7 +18,7 @@ ipch *.opensdf *.idb *.vcxproj -#*.sln +*.sln .vs/* # OSX/Linux build products From efc6c32c339d99679d3ddf9c73a869c790197e60 Mon Sep 17 00:00:00 2001 From: Andreas Date: Sat, 25 Jan 2020 20:23:11 +0100 Subject: [PATCH 5/8] updated gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 687dfb18..5668271b 100644 --- a/.gitignore +++ b/.gitignore @@ -65,6 +65,7 @@ sp/game/mod_hl2/stats.txt sp/game/mod_hl2/voice_ban.dt +*.vcxproj.FileListAbsolute.txt *.vpc_crc *.sentinel *.filters @@ -72,4 +73,4 @@ sp/game/mod_hl2/voice_ban.dt #game directories sp/game/* -mp/game/* \ No newline at end of file +mp/game/* From 3b0319d0094bcdba5598297f00db2a64b6817f12 Mon Sep 17 00:00:00 2001 From: Andreas Date: Sat, 25 Jan 2020 20:25:48 +0100 Subject: [PATCH 6/8] added bool for keping tack of queuejump status --- mp/src/game/shared/igamemovement.h | 1 + 1 file changed, 1 insertion(+) diff --git a/mp/src/game/shared/igamemovement.h b/mp/src/game/shared/igamemovement.h index ae248397..a414727c 100644 --- a/mp/src/game/shared/igamemovement.h +++ b/mp/src/game/shared/igamemovement.h @@ -40,6 +40,7 @@ class CMoveData public: bool m_bFirstRunOfFunctions : 1; bool m_bGameCodeMovedPlayer : 1; + bool m_bRejumpAllowed = 1; //keeping track of allowed jump status SA EntityHandle_t m_nPlayerHandle; // edict index on server, client entity handle on client From 3404d7f306b4567b48c8535cfc5ac5d4f0c2b37a Mon Sep 17 00:00:00 2001 From: Andreas Date: Sat, 25 Jan 2020 20:42:16 +0100 Subject: [PATCH 7/8] implemented main SA movement features and defcheck --- mp/src/game/shared/gamemovement.cpp | 101 +++++++++++++++++++------ mp/src/game/shared/movevars_shared.cpp | 14 ++-- 2 files changed, 85 insertions(+), 30 deletions(-) diff --git a/mp/src/game/shared/gamemovement.cpp b/mp/src/game/shared/gamemovement.cpp index fa88bfbf..b02f3ff6 100644 --- a/mp/src/game/shared/gamemovement.cpp +++ b/mp/src/game/shared/gamemovement.cpp @@ -36,6 +36,13 @@ extern IFileSystem *filesystem; #endif + +#define SA_MOVEMENT +ConVar sa_sv_pogostick("sv_pogostick", "0", FCVAR_REPLICATED, "queue jumps", 1, 0, 1, 1); +ConVar sa_sv_queuejump("sv_queuejump", "1", FCVAR_REPLICATED, "auto bunny hopping", 1, 0, 1, 1); + + + // tickcount currently isn't set during prediction, although gpGlobals->curtime and // gpGlobals->frametime are. We should probably set tickcount (to player->m_nTickBase), // but we're REALLY close to shipping, so we can change that later and people can use @@ -1199,6 +1206,14 @@ void CGameMovement::FinishTrackPredictionErrors( CBasePlayer *pPlayer ) //----------------------------------------------------------------------------- void CGameMovement::FinishMove( void ) { + ConVar* pPogoStick = cvar->FindVar("sv_pogostick"); + ConVar* pQueueJump = cvar->FindVar("sv_queuejump"); + if (!(mv->m_nButtons & IN_JUMP) && pQueueJump->GetInt() == 1) { + mv->m_bRejumpAllowed = true; + } + else if (pPogoStick->GetInt() == 1) { + mv->m_bRejumpAllowed = true; + } mv->m_nOldButtons = mv->m_nButtons; } @@ -1889,6 +1904,12 @@ void CGameMovement::StayOnGround( void ) } } +// Camera Bob +ConVar cl_camtilt_enabled("cl_camtilt_enabled", "1", 0, "Oscillation Toggle", true, 0, true, 1); +ConVar cl_viewbob_timer("cl_viewbob_timer", "1", 0, "Speed of Oscillation"); +ConVar cl_camtilt_scale("cl_camtilt_scale", "2.5", 0, "Magnitude of Oscillation"); + + //----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- @@ -1915,6 +1936,16 @@ void CGameMovement::WalkMove( void ) fmove = mv->m_flForwardMove; smove = mv->m_flSideMove; + if (cl_camtilt_enabled.GetInt() == 1 && !engine->IsPaused()) + { + float offset = 2 * cl_viewbob_timer.GetFloat() * player->GetAbsVelocity().Length() * cl_camtilt_scale.GetFloat() / 4000000 * smove; + QAngle playerAngles = mv->m_vecViewAngles; + QAngle camTilt(0, 0, offset); + QAngle resultAngles(playerAngles.x, playerAngles.y, playerAngles.z + camTilt.z); + player->ViewPunch(camTilt); + + } + // Zero out z components of movement vectors if ( g_bMovementOptimizations ) { @@ -2074,7 +2105,8 @@ void CGameMovement::FullWalkMove( ) // If we are on ground, no downward velocity. if ( player->GetGroundEntity() != NULL ) { - mv->m_vecVelocity[2] = 0; + mv->m_vecVelocity[2] = 0; + mv->m_bRejumpAllowed = true; } } else @@ -2353,6 +2385,8 @@ void CGameMovement::PlaySwimSound() //----------------------------------------------------------------------------- bool CGameMovement::CheckJumpButton( void ) { + ConVar* pPogoStick = cvar->FindVar("sv_pogostick"); + ConVar* pQueueJump = cvar->FindVar("sv_queuejump"); if (player->pl.deadflag) { mv->m_nOldButtons |= IN_JUMP ; // don't jump again until released @@ -2365,13 +2399,13 @@ bool CGameMovement::CheckJumpButton( void ) player->m_flWaterJumpTime -= gpGlobals->frametime; if (player->m_flWaterJumpTime < 0) player->m_flWaterJumpTime = 0; - + return false; } // If we are in the water most of the way... if ( player->GetWaterLevel() >= 2 ) - { + { // swimming, not jumping SetGroundEntity( NULL ); @@ -2379,7 +2413,7 @@ bool CGameMovement::CheckJumpButton( void ) mv->m_vecVelocity[2] = 100; else if (player->GetWaterType() == CONTENTS_SLIME) mv->m_vecVelocity[2] = 80; - + // play swiming sound if ( player->m_flSwimSoundTime <= 0 ) { @@ -2392,11 +2426,13 @@ bool CGameMovement::CheckJumpButton( void ) } // No more effect - if (player->GetGroundEntity() == NULL) + if (player->GetGroundEntity() == NULL) { - mv->m_nOldButtons |= IN_JUMP; + //Removed because we don't want the jump button to become 'unpressed' + // mv->m_nOldButtons |= IN_JUMP; return false; // in air, so no effect } + DevMsg("Got past getGroundEntity() == NULL \n"); // Don't allow jumping when the player is in a stasis field. #ifndef HL2_EPISODIC @@ -2404,35 +2440,47 @@ bool CGameMovement::CheckJumpButton( void ) return false; #endif - if ( mv->m_nOldButtons & IN_JUMP ) + //pressed jump on last tick/frame and both autojump and queuejump are disabled through console. + if ( mv->m_nOldButtons & IN_JUMP && !(mv->m_bRejumpAllowed ) ) { return false; // don't pogo stick + } + //DevMsg("Got past dont pogo \n"); // Cannot jump will in the unduck transition. - if ( player->m_Local.m_bDucking && ( player->GetFlags() & FL_DUCKING ) ) - return false; + //if ( player->m_Local.m_bDucking && ( player->GetFlags() & FL_DUCKING ) ) + //return false; // Still updating the eye position. - if ( player->m_Local.m_flDuckJumpTime > 0.0f ) - return false; + //if ( player->m_Local.m_flDuckJumpTime > 0.0f ) + //return false; + + + if (pPogoStick->GetInt() == 0) { + DevMsg("rejump disabled \n"); + mv->m_bRejumpAllowed = false; + } + + + // In the air now. - SetGroundEntity( NULL ); - + SetGroundEntity( NULL ); + player->PlayStepSound( (Vector &)mv->GetAbsOrigin(), player->m_pSurfaceData, 1.0, true ); - + MoveHelper()->PlayerSetAnimation( PLAYER_JUMP ); float flGroundFactor = 1.0f; if (player->m_pSurfaceData) { - flGroundFactor = player->m_pSurfaceData->game.jumpFactor; + flGroundFactor = player->m_pSurfaceData->game.jumpFactor; } float flMul; if ( g_bMovementOptimizations ) { -#if defined(HL2_DLL) || defined(HL2_CLIENT_DLL) +#if defined(HL2_DLL) &!defined(SArena_DLL) || defined(HL2_CLIENT_DLL) &!defined(SArena_DLL) Assert( GetCurrentGravity() == 600.0f ); flMul = 160.0f; // approx. 21 units. #else @@ -2443,7 +2491,10 @@ bool CGameMovement::CheckJumpButton( void ) } else { - flMul = sqrt(2 * GetCurrentGravity() * GAMEMOVEMENT_JUMP_HEIGHT); + //flMul = sqrt(2 * GetCurrentGravity() * GAMEMOVEMENT_JUMP_HEIGHT); + //We need these + Assert(GetCurrentGravity() == 800.0f); + flMul = 268.3281572999747f; } // Acclerate upward @@ -2473,7 +2524,7 @@ bool CGameMovement::CheckJumpButton( void ) AngleVectors( mv->m_vecViewAngles, &vecForward ); vecForward.z = 0; VectorNormalize( vecForward ); - + // We give a certain percentage of the current forward movement as a bonus to the jump speed. That bonus is clipped // to not accumulate over time. float flSpeedBoostPerc = ( !pMoveData->m_bIsSprinting && !player->m_Local.m_bDucked ) ? 0.5f : 0.1f; @@ -2523,9 +2574,13 @@ bool CGameMovement::CheckJumpButton( void ) } #endif - - // Flag that we jumped. - mv->m_nOldButtons |= IN_JUMP; // don't jump again until released + + //Commented out because idk why + //else if (pPogoStick->GetInt() == 0 && pQueueJump->GetInt() == 1 && player->GetGroundEntity() != NULL) { + // Flag that we jumped. + // mv->m_nOldButtons |= IN_JUMP; // don't jump again until released + //} + return true; } @@ -2840,7 +2895,7 @@ inline bool CGameMovement::OnLadder( trace_t &trace ) // HPE_BEGIN // [sbodenbender] make ladders easier to climb in cstrike //============================================================================= -#if defined (CSTRIKE_DLL) +#if defined (CSTRIKE_DLL) || defined( SArena_DLL ) ConVar sv_ladder_dampen ( "sv_ladder_dampen", "0.2", FCVAR_REPLICATED, "Amount to dampen perpendicular movement on a ladder", true, 0.0f, true, 1.0f ); ConVar sv_ladder_angle( "sv_ladder_angle", "-0.707", FCVAR_REPLICATED, "Cos of angle of incidence to ladder perpendicular for applying ladder_dampen", true, -1.0f, true, 1.0f ); #endif @@ -2977,7 +3032,7 @@ bool CGameMovement::LadderMove( void ) // HPE_BEGIN // [sbodenbender] make ladders easier to climb in cstrike //============================================================================= -#if defined (CSTRIKE_DLL) +#if defined (CSTRIKE_DLL) || defined( SArena_DLL ) // break lateral into direction along tmp (up the ladder) and direction along perp (perpendicular to ladder) float tmpDist = DotProduct ( tmp, lateral ); float perpDist = DotProduct ( perp, lateral ); diff --git a/mp/src/game/shared/movevars_shared.cpp b/mp/src/game/shared/movevars_shared.cpp index b5b94c72..dd402929 100644 --- a/mp/src/game/shared/movevars_shared.cpp +++ b/mp/src/game/shared/movevars_shared.cpp @@ -16,7 +16,7 @@ #include "tier0/memdbgon.h" // some cvars used by player movement system -#if defined( HL2_DLL ) || defined( HL2_CLIENT_DLL ) +#if defined( HL2_DLL ) &! defined( SArena_DLL ) || defined( HL2_CLIENT_DLL ) &! defined( SArena_DLL ) #define DEFAULT_GRAVITY_STRING "600" #else #define DEFAULT_GRAVITY_STRING "800" @@ -36,7 +36,7 @@ float GetCurrentGravity( void ) ConVar sv_gravity ( "sv_gravity", DEFAULT_GRAVITY_STRING, FCVAR_NOTIFY | FCVAR_REPLICATED, "World gravity." ); -#if defined( DOD_DLL ) || defined( CSTRIKE_DLL ) || defined( HL1MP_DLL ) +#if defined( DOD_DLL ) || defined( CSTRIKE_DLL ) || defined( HL1MP_DLL ) || defined( SArena_DLL ) ConVar sv_stopspeed ( "sv_stopspeed","100", FCVAR_NOTIFY | FCVAR_REPLICATED, "Minimum stopping speed when on ground." ); #else ConVar sv_stopspeed ( "sv_stopspeed","100", FCVAR_NOTIFY | FCVAR_REPLICATED | FCVAR_DEVELOPMENTONLY, "Minimum stopping speed when on ground." ); @@ -48,7 +48,7 @@ ConVar sv_specaccelerate( "sv_specaccelerate", "5", FCVAR_NOTIFY | FCVAR_ARCHIVE ConVar sv_specspeed ( "sv_specspeed", "3", FCVAR_ARCHIVE | FCVAR_NOTIFY | FCVAR_REPLICATED); ConVar sv_specnoclip ( "sv_specnoclip", "1", FCVAR_ARCHIVE | FCVAR_NOTIFY | FCVAR_REPLICATED); -#if defined( CSTRIKE_DLL ) || defined( HL1MP_DLL ) +#if defined( CSTRIKE_DLL ) || defined( HL1MP_DLL ) || defined( SArena_DLL ) ConVar sv_maxspeed ( "sv_maxspeed", "320", FCVAR_NOTIFY | FCVAR_REPLICATED); #else ConVar sv_maxspeed ( "sv_maxspeed", "320", FCVAR_NOTIFY | FCVAR_REPLICATED | FCVAR_DEVELOPMENTONLY); @@ -58,7 +58,7 @@ ConVar sv_maxspeed ( "sv_maxspeed", "320", FCVAR_NOTIFY | FCVAR_REPLICATED | FC ConVar sv_accelerate ( "sv_accelerate", "7", FCVAR_NOTIFY | FCVAR_REPLICATED); #else -#if defined( CSTRIKE_DLL ) || defined( HL1MP_DLL ) +#if defined( CSTRIKE_DLL ) || defined( HL1MP_DLL ) || defined( SArena_DLL ) ConVar sv_accelerate ( "sv_accelerate", "10", FCVAR_NOTIFY | FCVAR_REPLICATED); #else ConVar sv_accelerate ( "sv_accelerate", "10", FCVAR_NOTIFY | FCVAR_REPLICATED | FCVAR_DEVELOPMENTONLY); @@ -66,7 +66,7 @@ ConVar sv_maxspeed ( "sv_maxspeed", "320", FCVAR_NOTIFY | FCVAR_REPLICATED | FC #endif//_XBOX -#if defined( CSTRIKE_DLL ) || defined( HL1MP_DLL ) +#if defined( CSTRIKE_DLL ) || defined( HL1MP_DLL ) || defined( SArena_DLL ) //we need these to not be hidden ConVar sv_airaccelerate( "sv_airaccelerate", "10", FCVAR_NOTIFY | FCVAR_REPLICATED); ConVar sv_wateraccelerate( "sv_wateraccelerate", "10", FCVAR_NOTIFY | FCVAR_REPLICATED); ConVar sv_waterfriction( "sv_waterfriction", "1", FCVAR_NOTIFY | FCVAR_REPLICATED); @@ -82,13 +82,13 @@ ConVar sv_rollspeed ( "sv_rollspeed", "200", FCVAR_NOTIFY | FCVAR_REPLICATED | F ConVar sv_rollangle ( "sv_rollangle", "0", FCVAR_NOTIFY | FCVAR_REPLICATED | FCVAR_DEVELOPMENTONLY, "Max view roll angle"); #endif // CSTRIKE_DLL -#if defined( DOD_DLL ) || defined( CSTRIKE_DLL ) || defined( HL1MP_DLL ) +#if defined( DOD_DLL ) || defined( CSTRIKE_DLL ) || defined( HL1MP_DLL ) || defined( SArena_DLL ) //need these too ConVar sv_friction ( "sv_friction","4", FCVAR_NOTIFY | FCVAR_REPLICATED, "World friction." ); #else ConVar sv_friction ( "sv_friction","4", FCVAR_NOTIFY | FCVAR_REPLICATED | FCVAR_DEVELOPMENTONLY, "World friction." ); #endif // DOD_DLL || CSTRIKE_DLL -#if defined( CSTRIKE_DLL ) || defined( HL1MP_DLL ) +#if defined( CSTRIKE_DLL ) || defined( HL1MP_DLL ) || defined( SArena_DLL ) //need these too ConVar sv_bounce ( "sv_bounce","0", FCVAR_NOTIFY | FCVAR_REPLICATED, "Bounce multiplier for when physically simulated objects collide with other objects." ); ConVar sv_maxvelocity ( "sv_maxvelocity","3500", FCVAR_REPLICATED, "Maximum speed any ballistically moving object is allowed to attain per axis." ); ConVar sv_stepsize ( "sv_stepsize","18", FCVAR_NOTIFY | FCVAR_REPLICATED ); From 13f49b388b69f65713ed364f5f881ea26c059ec3 Mon Sep 17 00:00:00 2001 From: Andreas Date: Fri, 21 Feb 2020 00:41:09 +0100 Subject: [PATCH 8/8] fucked around with abh code --- mp/src/game/shared/gamemovement.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/mp/src/game/shared/gamemovement.cpp b/mp/src/game/shared/gamemovement.cpp index b02f3ff6..843e360a 100644 --- a/mp/src/game/shared/gamemovement.cpp +++ b/mp/src/game/shared/gamemovement.cpp @@ -36,8 +36,9 @@ extern IFileSystem *filesystem; #endif - -#define SA_MOVEMENT +#ifndef SA_MOVEMENT + #define SA_MOVEMENT +#endif ConVar sa_sv_pogostick("sv_pogostick", "0", FCVAR_REPLICATED, "queue jumps", 1, 0, 1, 1); ConVar sa_sv_queuejump("sv_queuejump", "1", FCVAR_REPLICATED, "auto bunny hopping", 1, 0, 1, 1); @@ -2387,6 +2388,7 @@ bool CGameMovement::CheckJumpButton( void ) { ConVar* pPogoStick = cvar->FindVar("sv_pogostick"); ConVar* pQueueJump = cvar->FindVar("sv_queuejump"); + if (player->pl.deadflag) { mv->m_nOldButtons |= IN_JUMP ; // don't jump again until released @@ -2517,8 +2519,8 @@ bool CGameMovement::CheckJumpButton( void ) // Add a little forward velocity based on your current forward velocity - if you are not sprinting. #if defined( HL2_DLL ) || defined( HL2_CLIENT_DLL ) - if ( gpGlobals->maxClients == 1 ) - { + //if ( gpGlobals->maxClients == 1 ) + //{ CHLMoveData *pMoveData = ( CHLMoveData* )mv; Vector vecForward; AngleVectors( mv->m_vecViewAngles, &vecForward ); @@ -2535,7 +2537,7 @@ bool CGameMovement::CheckJumpButton( void ) // If we're over the maximum, we want to only boost as much as will get us to the goal speed if ( flNewSpeed > flMaxSpeed ) { - flSpeedAddition -= flNewSpeed - flMaxSpeed; + //flSpeedAddition -= flNewSpeed - flMaxSpeed; } if ( mv->m_flForwardMove < 0.0f ) @@ -2543,7 +2545,7 @@ bool CGameMovement::CheckJumpButton( void ) // Add it on VectorAdd( (vecForward*flSpeedAddition), mv->m_vecVelocity, mv->m_vecVelocity ); - } + //} #endif FinishGravity(); @@ -2576,10 +2578,10 @@ bool CGameMovement::CheckJumpButton( void ) #endif //Commented out because idk why - //else if (pPogoStick->GetInt() == 0 && pQueueJump->GetInt() == 1 && player->GetGroundEntity() != NULL) { + else if (pPogoStick->GetInt() == 0 && pQueueJump->GetInt() == 1 && player->GetGroundEntity() != NULL) { // Flag that we jumped. - // mv->m_nOldButtons |= IN_JUMP; // don't jump again until released - //} + mv->m_nOldButtons |= IN_JUMP; // don't jump again until released + } return true; }