本文整理汇总了C++中IServerVehicle::FinishMove方法的典型用法代码示例。如果您正苦于以下问题:C++ IServerVehicle::FinishMove方法的具体用法?C++ IServerVehicle::FinishMove怎么用?C++ IServerVehicle::FinishMove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IServerVehicle
的用法示例。
在下文中一共展示了IServerVehicle::FinishMove方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FinishMove
void CHLPlayerMove::FinishMove( CBasePlayer *player, CUserCmd *ucmd, CMoveData *move )
{
// Call the default FinishMove code.
BaseClass::FinishMove( player, ucmd, move );
IServerVehicle *pVehicle = player->GetVehicle();
if (pVehicle && gpGlobals->frametime != 0)
{
pVehicle->FinishMove( player, ucmd, move );
}
}
示例2: FinishMove
void CHLPlayerMove::FinishMove( CBasePlayer *player, CUserCmd *ucmd, CMoveData *move )
{
// Call the default FinishMove code.
BaseClass::FinishMove( player, ucmd, move );
if ( gpGlobals->frametime != 0 )
{
float distance = 0.0f;
IServerVehicle *pVehicle = player->GetVehicle();
if ( pVehicle )
{
pVehicle->FinishMove( player, ucmd, move );
IPhysicsObject *obj = player->GetVehicleEntity()->VPhysicsGetObject();
if ( obj )
{
Vector newPos;
obj->GetPosition( &newPos, NULL );
distance = VectorLength( newPos - m_vecSaveOrigin );
if ( m_vecSaveOrigin == vec3_origin || distance > 100.0f )
distance = 0.0f;
m_vecSaveOrigin = newPos;
}
CPropVehicleDriveable *driveable = dynamic_cast< CPropVehicleDriveable * >( player->GetVehicleEntity() );
if ( driveable )
{
// Overturned and at rest (if still moving it can fix itself)
bool bFlipped = driveable->IsOverturned() && ( distance < 0.5f );
if ( m_bVehicleFlipped != bFlipped )
{
if ( bFlipped )
{
gamestats->Event_FlippedVehicle( player, driveable );
}
m_bVehicleFlipped = bFlipped;
}
}
else
{
m_bVehicleFlipped = false;
}
}
else
{
m_bVehicleFlipped = false;
distance = VectorLength( player->GetAbsOrigin() - m_vecSaveOrigin );
}
if ( distance > 0 )
{
gamestats->Event_PlayerTraveled( player, distance, pVehicle ? true : false, !pVehicle && static_cast< CHL2_Player * >( player )->IsSprinting() );
}
}
bool bGodMode = ( player->GetFlags() & FL_GODMODE ) ? true : false;
if ( m_bInGodMode != bGodMode )
{
m_bInGodMode = bGodMode;
if ( bGodMode )
{
gamestats->Event_PlayerEnteredGodMode( player );
}
}
bool bNoClip = ( player->GetMoveType() == MOVETYPE_NOCLIP );
if ( m_bInNoClip != bNoClip )
{
m_bInNoClip = bNoClip;
if ( bNoClip )
{
gamestats->Event_PlayerEnteredNoClip( player );
}
}
}