diff --git a/game/client/cstrike/c_cs_player.cpp b/game/client/cstrike/c_cs_player.cpp index 8132447bed..2a2cf0bc63 100644 --- a/game/client/cstrike/c_cs_player.cpp +++ b/game/client/cstrike/c_cs_player.cpp @@ -2232,6 +2232,16 @@ void C_CSPlayer::Simulate( void ) DrawClientHitboxes(0.0f, true); } +void C_CSPlayer::PostThink() +{ + BaseClass::PostThink(); + // Reset this.. it gets reset each frame that we're in a bomb zone. + m_bInBombZone = false; + m_bInBuyZone = false; + m_bInHostageRescueZone = false; +} + + void C_CSPlayer::ReleaseFlashlight( void ) { if( m_pFlashlightBeam ) diff --git a/game/client/cstrike/c_cs_player.h b/game/client/cstrike/c_cs_player.h index 5251f69e92..b001e832ce 100644 --- a/game/client/cstrike/c_cs_player.h +++ b/game/client/cstrike/c_cs_player.h @@ -45,6 +45,7 @@ public: ~C_CSPlayer(); virtual void Simulate(); + virtual void PostThink(); bool HasDefuser() const; @@ -227,7 +228,7 @@ public: CNetworkVar( bool, m_bInBombZone ); CNetworkVar( bool, m_bInBuyZone ); CNetworkVar( int, m_iThrowGrenadeCounter ); // used to trigger grenade throw animations. - + bool m_bInHostageRescueZone; bool IsInHostageRescueZone( void ); // This is a combination of the ADDON_ flags in cs_shareddefs.h. @@ -324,7 +325,6 @@ private: int m_ArmorValue; QAngle m_angEyeAngles; bool m_bHasDefuser; - bool m_bInHostageRescueZone; float m_fNextThinkPushAway; bool m_bPlayingFreezeCamSound; diff --git a/game/client/cstrike/cs_prediction.cpp b/game/client/cstrike/cs_prediction.cpp index 32cf88c981..1b4a0013f9 100644 --- a/game/client/cstrike/cs_prediction.cpp +++ b/game/client/cstrike/cs_prediction.cpp @@ -5,6 +5,7 @@ // $NoKeywords: $ //=============================================================================// #include "cbase.h" +#include "iclientvehicle.h" #include "prediction.h" #include "c_cs_player.h" #include "igamemovement.h" @@ -19,10 +20,19 @@ class CCSPrediction : public CPrediction DECLARE_CLASS( CCSPrediction, CPrediction ); public: + virtual void StartCommand( CBasePlayer *player, CUserCmd *cmd ); virtual void SetupMove( C_BasePlayer *player, CUserCmd *ucmd, IMoveHelper *pHelper, CMoveData *move ); virtual void FinishMove( C_BasePlayer *player, CUserCmd *ucmd, CMoveData *move ); }; +void CCSPrediction::StartCommand(CBasePlayer* player, CUserCmd* cmd) +{ + CCSPlayer *pPlayer = ToCSPlayer( player ); + + BaseClass::StartCommand( player, cmd ); +} + + //----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- @@ -33,6 +43,12 @@ void CCSPrediction::SetupMove( C_BasePlayer *player, CUserCmd *ucmd, IMoveHelper // Call the default SetupMove code. BaseClass::SetupMove( player, ucmd, pHelper, move ); + + IClientVehicle *pVehicle = player->GetVehicle(); + if (pVehicle && gpGlobals->frametime != 0) + { + pVehicle->SetupMove( player, ucmd, pHelper, move ); + } } //----------------------------------------------------------------------------- @@ -42,6 +58,12 @@ void CCSPrediction::FinishMove( C_BasePlayer *player, CUserCmd *ucmd, CMoveData { // Call the default FinishMove code. BaseClass::FinishMove( player, ucmd, move ); + + IClientVehicle *pVehicle = player->GetVehicle(); + if (pVehicle && gpGlobals->frametime != 0) + { + pVehicle->FinishMove( player, ucmd, move ); + } } diff --git a/game/client/prediction.cpp b/game/client/prediction.cpp index a6943da74e..da1a13ce44 100644 --- a/game/client/prediction.cpp +++ b/game/client/prediction.cpp @@ -883,6 +883,8 @@ void CPrediction::RunCommand( C_BasePlayer *player, CUserCmd *ucmd, IMoveHelper PREDICTION_TRACKVALUECHANGESCOPE( sz ); #endif + StartCommand( player, ucmd ); + g_pGameMovement->StartTrackPredictionErrors( player ); gpGlobals->frametime = m_bEnginePaused ? 0 : TICK_INTERVAL; @@ -893,8 +895,6 @@ void CPrediction::RunCommand( C_BasePlayer *player, CUserCmd *ucmd, IMoveHelper gpGlobals->curtime = player->m_nTickBase * TICK_INTERVAL; - StartCommand( player, ucmd ); - // TODO // TODO: Check for impulse predicted? diff --git a/game/server/cstrike/cs_player.cpp b/game/server/cstrike/cs_player.cpp index 8d6a8ef11c..a0c546be22 100644 --- a/game/server/cstrike/cs_player.cpp +++ b/game/server/cstrike/cs_player.cpp @@ -1630,6 +1630,11 @@ void CCSPlayer::PostThink() StopSound( "Player.AmbientUnderWater" ); SetPlayerUnderwater( false ); } + + // Reset this.. it gets reset each frame that we're in a bomb zone. + m_bInBombZone = false; + m_bInBuyZone = false; + m_bInHostageRescueZone = false; } diff --git a/game/server/player_command.cpp b/game/server/player_command.cpp index d586cc4ffb..5b9fd6bd13 100644 --- a/game/server/player_command.cpp +++ b/game/server/player_command.cpp @@ -336,16 +336,15 @@ void CPlayerMove::RunCommand ( CBasePlayer *player, CUserCmd *ucmd, IMoveHelper return; // Don't process this command } + StartCommand( player, ucmd ); g_pGameMovement->StartTrackPredictionErrors( player ); - + gpGlobals->frametime = playerFrameTime; gpGlobals->curtime = (player->m_nTickBase - 1) * TICK_INTERVAL; // Run post think first, this will let some space for client side interpolation. RunPostThink( player ); - - StartCommand( player, ucmd ); // Set globals appropriately gpGlobals->curtime = player->m_nTickBase * TICK_INTERVAL;