[Bug] Played view distorted if you have ridden an entity


(Chruker) #1

Hi

I’m trying to solve the bug where the player view is distorted when have ridden an entity right before you are moved to intermission. I figured the problem might lie in MoveClientToIntermission() in g_main.c, so I added this code to make sure all origins are set to the intermission one:

	// clean up powerup info
	// memset( ent->client->ps.powerups, 0, sizeof(ent->client->ps.powerups) );

	// CHRUKER: b088 - Player view is distorted in intermission if you have ridden an vehicle, mounted a tank, or deployed a MG42
	if( ent->tankLink ) {G_LeaveTank( ent, qfalse );}

	VectorClear( ent->client->ps.velocity );

	VectorCopy( level.intermission_origin, ent->r.currentOrigin );

	VectorCopy( level.intermission_origin, ent->s.pos.trBase ); 
	ent->s.pos.trType = TR_STATIONARY; 
	ent->s.pos.trTime = 0; 
	ent->s.pos.trDuration = 0; 
	VectorClear( ent->s.pos.trDelta ); 

	VectorCopy( level.intermission_angle, ent->r.currentAngles );

	VectorCopy( level.intermission_angle, ent->s.apos.trBase ); 
	ent->s.apos.trType = TR_STATIONARY; 
	ent->s.apos.trTime = 0; 
	ent->s.apos.trDuration = 0; 
	VectorClear( ent->s.apos.trDelta ); 
	// b088

	ent->client->ps.eFlags = 0;
	ent->s.eFlags = 0;

However it still doesn’t solve the bug.

One curiosity, which might indicate that this is client side bug, is the if you do all this with cg_nopredict 1 there is no distortion.

Steps to reproduce the bug:

  • Start the Subway map
  • Get into the train and stand between the bars, so that you don’t fall off when the train turns.
  • Type /timelimit 0.1 in the console
  • Watch how the view is shaken when the train would be turning.

(Chruker) #2

Ok, scrap those origin copying. In cg_predict.c around line 802 there is this code:


	// CHRUKER: b088 - Player view is distorted in intermission if you have ridden an vehicle, mounted a tank
	// non-predicting local movement will grab the latest angles
	if ( cg_nopredict.integer || cg.predictedPlayerState.pm_type == PM_INTERMISSION
#ifdef ALLOW_GSYNC
		|| cg_synchronousClients.integer 
#endif // ALLOW_GSYNC

I’ve added the cg.predictedPlayerState.pm_type == PM_INTERMISSION, and I haven’t been able to detect any bugs resulting from it.

Should there be any bugs? Hmm. Can an intermission point of view move? Edit: No the can’t