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
55 lines
1.6 KiB
//========= Copyright Valve Corporation, All rights reserved. ============//
|
|
//
|
|
// Purpose:
|
|
//
|
|
// $NoKeywords: $
|
|
//=============================================================================//
|
|
#include "cbase.h"
|
|
#include "prediction.h"
|
|
#include "c_cs_player.h"
|
|
#include "igamemovement.h"
|
|
|
|
|
|
static CMoveData g_MoveData;
|
|
CMoveData *g_pMoveData = &g_MoveData;
|
|
|
|
|
|
class CCSPrediction : public CPrediction
|
|
{
|
|
DECLARE_CLASS( CCSPrediction, CPrediction );
|
|
|
|
public:
|
|
virtual void SetupMove( C_BasePlayer *player, CUserCmd *ucmd, IMoveHelper *pHelper, CMoveData *move );
|
|
virtual void FinishMove( C_BasePlayer *player, CUserCmd *ucmd, CMoveData *move );
|
|
};
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// Purpose:
|
|
//-----------------------------------------------------------------------------
|
|
void CCSPrediction::SetupMove( C_BasePlayer *player, CUserCmd *ucmd, IMoveHelper *pHelper,
|
|
CMoveData *move )
|
|
{
|
|
player->AvoidPhysicsProps( ucmd );
|
|
|
|
// Call the default SetupMove code.
|
|
BaseClass::SetupMove( player, ucmd, pHelper, move );
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// Purpose:
|
|
//-----------------------------------------------------------------------------
|
|
void CCSPrediction::FinishMove( C_BasePlayer *player, CUserCmd *ucmd, CMoveData *move )
|
|
{
|
|
// Call the default FinishMove code.
|
|
BaseClass::FinishMove( player, ucmd, move );
|
|
}
|
|
|
|
|
|
// Expose interface to engine
|
|
// Expose interface to engine
|
|
static CCSPrediction g_Prediction;
|
|
|
|
EXPOSE_SINGLE_INTERFACE_GLOBALVAR( CCSPrediction, IPrediction, VCLIENT_PREDICTION_INTERFACE_VERSION, g_Prediction );
|
|
|
|
CPrediction *prediction = &g_Prediction;
|
|
|