From cf69910a6b32bf8e6f21d401b36533987c94221e Mon Sep 17 00:00:00 2001 From: Spoike Date: Thu, 27 Jan 2005 01:53:05 +0000 Subject: [PATCH] That's the angles compleatly smoothed now git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@836 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/server/sv_ents.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/engine/server/sv_ents.c b/engine/server/sv_ents.c index c7bbb3668..f3493c016 100644 --- a/engine/server/sv_ents.c +++ b/engine/server/sv_ents.c @@ -1131,6 +1131,7 @@ void SV_WritePlayersToClient (client_t *client, edict_t *clent, qbyte *pvs, size vec3_t org; vec3_t vel; float lerp; + float a1, a2; extern vec3_t player_mins, player_maxs; clstate_t clst; extern float olddemotime, nextdemotime; @@ -1176,7 +1177,14 @@ void SV_WritePlayersToClient (client_t *client, edict_t *clent, qbyte *pvs, size lerp = 1; for (j = 0; j < 3; j++) { - ang[j] = (360.0f/256)*(sv.recordedplayer[i].oldang[j] + (sv.demostate[i+1].angles[j] - sv.recordedplayer[i].oldang[j])*lerp); + a1 = (360.0f/256)*sv.recordedplayer[i].oldang[j]; + a2 = (360.0f/256)*sv.demostate[i+1].angles[j]; + a2 = a2 - a1; + if (a2 > 180) + a2-=360; + if (a2 < -180) + a2+=360; + ang[j] = (a1 + (a2)*lerp); org[j] = sv.recordedplayer[i].oldorg[j] + (sv.demostate[i+1].origin[j] - sv.recordedplayer[i].oldorg[j])*lerp;