etmain wasn't copying ps->velocity into s.pos.trDelta: wh


(Zaedyn) #1

If you look in BG_PlayerStateToEntityState() a little ways down you see this:


	VectorCopy( ps->origin, s->pos.trBase );
	if ( snap ) {
		SnapVector( s->pos.trBase );
	}

What you don’t see anywhere is this:


	VectorCopy( ps->velocity, s->pos.trDelta );
	if ( snap ) {
		SnapVector( s->pos.trDelta );
	}

Anyone know why? I put the latter in because otherwise unlagged’s skip correction has bogus velocities to extrapolate from.

I also noticed that ClientThink_real() has this:


	// Gordon: thx to bani for this
	// ikkyo - fix leaning players bug
	VectorCopy( client->ps.velocity, ent->s.pos.trDelta );                  
	SnapVector( ent->s.pos.trDelta );
	// end

Which I removed since I added it to BG_PlayerStateToEntityState().

Is there a good reason for not doing this in BG_PlayerStateToEntityState()? It was done in Quake 3.


(Chruker) #2

Is there a good reason for not doing this in BG_PlayerStateToEntityState()?

When the trajectory type is TR_INTERPOLATE, the trDelta’s aren’t used, so there isn’t any need to set the velocity.

EDIT: The bpark link in your signature doesn’t work. It has a , in it :slight_smile:


(Zaedyn) #3

So if I do store it and snap it will it remain unchanged and still equal to ps->velocity when I get down to the end of ClientEndFrame()?

Doh! Thanks. Fixed!


(Chruker) #4

So if I do store it and snap it will it remain unchanged and still equal to ps->velocity when I get down to the end of ClientEndFrame()?

I don’t know exactly.

My only guess to why it was removed, would be because it wasn’t needed.