Team Fortress 2 Source Code as on 22/4/2020
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.

55 lines
1.6 KiB

  1. //========= Copyright 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. static CMoveData g_MoveData;
  12. CMoveData *g_pMoveData = &g_MoveData;
  13. class CCSPrediction : public CPrediction
  14. {
  15. DECLARE_CLASS( CCSPrediction, CPrediction );
  16. public:
  17. virtual void SetupMove( C_BasePlayer *player, CUserCmd *ucmd, IMoveHelper *pHelper, CMoveData *move );
  18. virtual void FinishMove( C_BasePlayer *player, CUserCmd *ucmd, CMoveData *move );
  19. };
  20. //-----------------------------------------------------------------------------
  21. // Purpose:
  22. //-----------------------------------------------------------------------------
  23. void CCSPrediction::SetupMove( C_BasePlayer *player, CUserCmd *ucmd, IMoveHelper *pHelper,
  24. CMoveData *move )
  25. {
  26. player->AvoidPhysicsProps( ucmd );
  27. // Call the default SetupMove code.
  28. BaseClass::SetupMove( player, ucmd, pHelper, move );
  29. }
  30. //-----------------------------------------------------------------------------
  31. // Purpose:
  32. //-----------------------------------------------------------------------------
  33. void CCSPrediction::FinishMove( C_BasePlayer *player, CUserCmd *ucmd, CMoveData *move )
  34. {
  35. // Call the default FinishMove code.
  36. BaseClass::FinishMove( player, ucmd, move );
  37. }
  38. // Expose interface to engine
  39. // Expose interface to engine
  40. static CCSPrediction g_Prediction;
  41. EXPOSE_SINGLE_INTERFACE_GLOBALVAR( CCSPrediction, IPrediction, VCLIENT_PREDICTION_INTERFACE_VERSION, g_Prediction );
  42. CPrediction *prediction = &g_Prediction;