Skip to content

Commit

Permalink
Sometimes teleports wouldn't work because physics impacts were proces…
Browse files Browse the repository at this point in the history
…sed before the player's thinkings, fixed it by moving the processed impacts before thinking functions.
  • Loading branch information
XutaxKamay committed Dec 20, 2017
1 parent ff47d39 commit d370302
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions mp/src/game/server/player_command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,11 @@ void CPlayerMove::RunCommand ( CBasePlayer *player, CUserCmd *ucmd, IMoveHelper
{
player->pl.v_angle = ucmd->viewangles + player->pl.anglechange;
}

// Let server invoke any needed impact functions
VPROF_SCOPE_BEGIN( "moveHelper->ProcessImpacts" );
moveHelper->ProcessImpacts();
VPROF_SCOPE_END();

// Call standard client pre-think
RunPreThink( player );
Expand Down Expand Up @@ -451,11 +456,6 @@ void CPlayerMove::RunCommand ( CBasePlayer *player, CUserCmd *ucmd, IMoveHelper
player->pl.v_angle = player->GetLockViewanglesData();
}

// Let server invoke any needed impact functions
VPROF_SCOPE_BEGIN( "moveHelper->ProcessImpacts" );
moveHelper->ProcessImpacts();
VPROF_SCOPE_END();

g_pGameMovement->FinishTrackPredictionErrors( player );

FinishCommand( player );
Expand Down
10 changes: 5 additions & 5 deletions sp/src/game/server/player_command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,11 @@ void CPlayerMove::RunCommand ( CBasePlayer *player, CUserCmd *ucmd, IMoveHelper
{
player->pl.v_angle = ucmd->viewangles + player->pl.anglechange;
}

// Let server invoke any needed impact functions
VPROF_SCOPE_BEGIN( "moveHelper->ProcessImpacts" );
moveHelper->ProcessImpacts();
VPROF_SCOPE_END();

// Call standard client pre-think
RunPreThink( player );
Expand Down Expand Up @@ -444,11 +449,6 @@ void CPlayerMove::RunCommand ( CBasePlayer *player, CUserCmd *ucmd, IMoveHelper
// Copy output
FinishMove( player, ucmd, g_pMoveData );

// Let server invoke any needed impact functions
VPROF_SCOPE_BEGIN( "moveHelper->ProcessImpacts" );
moveHelper->ProcessImpacts();
VPROF_SCOPE_END();

g_pGameMovement->FinishTrackPredictionErrors( player );

FinishCommand( player );
Expand Down

0 comments on commit d370302

Please sign in to comment.