Skip to content

Commit

Permalink
Use old_pmove for teleport velocity instead of modifying pmove_state_t
Browse files Browse the repository at this point in the history
  • Loading branch information
kalhartt committed Mar 22, 2014
1 parent d1a855c commit 9274821
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion source/game/g_trigger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ static void old_teleporter_touch( edict_t *self, edict_t *other, cplane_t *plane
// teleport the player
//

VectorCopy( other->r.client->ps.pmove.previous_velocity, velocity ); // racesow - use last frame's velocity
VectorCopy( other->r.client->old_pmove.velocity, velocity ); // racesow - use old pmove velocity

velocity[2] = 0; // ignore vertical velocity
speed = VectorLengthFast( velocity );
Expand Down
2 changes: 0 additions & 2 deletions source/gameshared/gs_pmove.c
Original file line number Diff line number Diff line change
Expand Up @@ -1766,8 +1766,6 @@ void Pmove( pmove_t *pmove )
// clear all pmove local vars
memset( &pml, 0, sizeof( pml ) );

VectorCopy( pm->playerState->pmove.origin, pm->playerState->pmove.previous_origin ); // racesow
VectorCopy( pm->playerState->pmove.velocity, pm->playerState->pmove.previous_velocity ); // racesow
VectorCopy( pm->playerState->pmove.origin, pml.origin );
VectorCopy( pm->playerState->pmove.velocity, pml.velocity );

Expand Down
2 changes: 0 additions & 2 deletions source/gameshared/q_comref.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ typedef struct

float origin[3]; // 12.3
float velocity[3]; // 12.3
float previous_origin[3]; // racesow
float previous_velocity[3]; // racesow

int pm_flags; // ducked, jump_held, etc
int pm_time; // each unit = 8 ms
Expand Down

0 comments on commit 9274821

Please sign in to comment.