Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.7 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #include "cbase.h"
  8. #include "prediction.h"
  9. #include "c_cs_player.h"
  10. #include "igamemovement.h"
  11. // NOTE: This has to be the last file included!
  12. #include "tier0/memdbgon.h"
  13. static CMoveData g_MoveData;
  14. CMoveData *g_pMoveData = &g_MoveData;
  15. class CCSPrediction : public CPrediction
  16. {
  17. DECLARE_CLASS( CCSPrediction, CPrediction );
  18. public:
  19. virtual void SetupMove( C_BasePlayer *player, CUserCmd *ucmd, IMoveHelper *pHelper, CMoveData *move );
  20. virtual void FinishMove( C_BasePlayer *player, CUserCmd *ucmd, CMoveData *move );
  21. };
  22. //-----------------------------------------------------------------------------
  23. // Purpose:
  24. //-----------------------------------------------------------------------------
  25. void CCSPrediction::SetupMove( C_BasePlayer *player, CUserCmd *ucmd, IMoveHelper *pHelper,
  26. CMoveData *move )
  27. {
  28. player->AvoidPhysicsProps( ucmd );
  29. // Call the default SetupMove code.
  30. BaseClass::SetupMove( player, ucmd, pHelper, move );
  31. }
  32. //-----------------------------------------------------------------------------
  33. // Purpose:
  34. //-----------------------------------------------------------------------------
  35. void CCSPrediction::FinishMove( C_BasePlayer *player, CUserCmd *ucmd, CMoveData *move )
  36. {
  37. // Call the default FinishMove code.
  38. BaseClass::FinishMove( player, ucmd, move );
  39. }
  40. // Expose interface to engine
  41. // Expose interface to engine
  42. static CCSPrediction g_Prediction;
  43. EXPOSE_SINGLE_INTERFACE_GLOBALVAR( CCSPrediction, IPrediction, VCLIENT_PREDICTION_INTERFACE_VERSION, g_Prediction );
  44. CPrediction *prediction = &g_Prediction;