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.

80 lines
2.8 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #include "cbase.h"
  8. #include "player_command.h"
  9. #include "igamemovement.h"
  10. #include "in_buttons.h"
  11. #include "ipredictionsystem.h"
  12. #include "dod_player.h"
  13. static CMoveData g_MoveData;
  14. CMoveData *g_pMoveData = &g_MoveData;
  15. IPredictionSystem *IPredictionSystem::g_pPredictionSystems = NULL;
  16. //-----------------------------------------------------------------------------
  17. // Sets up the move data for TF2
  18. //-----------------------------------------------------------------------------
  19. class CDODPlayerMove : public CPlayerMove
  20. {
  21. DECLARE_CLASS( CDODPlayerMove, CPlayerMove );
  22. public:
  23. //virtual void StartCommand( CBasePlayer *player, CUserCmd *cmd );
  24. virtual void SetupMove( CBasePlayer *player, CUserCmd *ucmd, IMoveHelper *pHelper, CMoveData *move );
  25. virtual void FinishMove( CBasePlayer *player, CUserCmd *ucmd, CMoveData *move );
  26. };
  27. // PlayerMove Interface
  28. static CDODPlayerMove g_PlayerMove;
  29. //-----------------------------------------------------------------------------
  30. // Singleton accessor
  31. //-----------------------------------------------------------------------------
  32. CPlayerMove *PlayerMove()
  33. {
  34. return &g_PlayerMove;
  35. }
  36. //-----------------------------------------------------------------------------
  37. // Main setup, finish
  38. //-----------------------------------------------------------------------------
  39. /*
  40. void CDODPlayerMove::StartCommand( CBasePlayer *player, CUserCmd *cmd )
  41. {
  42. BaseClass::StartCommand( player, cmd );
  43. }
  44. */
  45. //-----------------------------------------------------------------------------
  46. // Purpose: This is called pre player movement and copies all the data necessary
  47. // from the player for movement. (Server-side, the client-side version
  48. // of this code can be found in prediction.cpp.)
  49. //-----------------------------------------------------------------------------
  50. void CDODPlayerMove::SetupMove( CBasePlayer *player, CUserCmd *ucmd, IMoveHelper *pHelper, CMoveData *move )
  51. {
  52. player->AvoidPhysicsProps( ucmd );
  53. BaseClass::SetupMove( player, ucmd, pHelper, move );
  54. }
  55. //-----------------------------------------------------------------------------
  56. // Purpose: This is called post player movement to copy back all data that
  57. // movement could have modified and that is necessary for future
  58. // movement. (Server-side, the client-side version of this code can
  59. // be found in prediction.cpp.)
  60. //-----------------------------------------------------------------------------
  61. void CDODPlayerMove::FinishMove( CBasePlayer *player, CUserCmd *ucmd, CMoveData *move )
  62. {
  63. // Call the default FinishMove code.
  64. BaseClass::FinishMove( player, ucmd, move );
  65. }