From a454cf411f2602982158b019553b64b050a2261c Mon Sep 17 00:00:00 2001 From: "Anton E. Gavrilov" Date: Mon, 22 May 2000 04:54:06 +0000 Subject: [PATCH] Add prediction for current player's effects --- source/cl_ents.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/source/cl_ents.c b/source/cl_ents.c index 2d51c2a..5055131 100644 --- a/source/cl_ents.c +++ b/source/cl_ents.c @@ -833,6 +833,7 @@ void CL_LinkPlayers (void) int msec; frame_t *frame; int oldphysent; + vec3_t org; playertime = realtime - cls.latency + 0.02; if (playertime > realtime) @@ -848,19 +849,23 @@ void CL_LinkPlayers (void) // FIXME: Use a findvar or something for gl_flashblend --KB // spawn light flashes, even ones coming from invisible objects -/* if (!gl_flashblend.value || j != cl.playernum) { - CVAR_FIXME */ if (!gl_flashblend->value || j != cl.playernum) { + + if (j == cl.playernum) { + VectorCopy (cl.simorg, org); + } else + VectorCopy (state->origin, org); + if ((state->effects & (EF_BLUE | EF_RED)) == (EF_BLUE | EF_RED)) - CL_NewDlight (j, state->origin[0], state->origin[1], state->origin[2], 200 + (rand()&31), 0.1, 3); + CL_NewDlight (j, org[0], org[1], org[2], 200 + (rand()&31), 0.1, 3); else if (state->effects & EF_BLUE) - CL_NewDlight (j, state->origin[0], state->origin[1], state->origin[2], 200 + (rand()&31), 0.1, 1); + CL_NewDlight (j, org[0], org[1], org[2], 200 + (rand()&31), 0.1, 1); else if (state->effects & EF_RED) - CL_NewDlight (j, state->origin[0], state->origin[1], state->origin[2], 200 + (rand()&31), 0.1, 2); + CL_NewDlight (j, org[0], org[1], org[2], 200 + (rand()&31), 0.1, 2); else if (state->effects & EF_BRIGHTLIGHT) - CL_NewDlight (j, state->origin[0], state->origin[1], state->origin[2] + 16, 400 + (rand()&31), 0.1, 0); + CL_NewDlight (j, org[0], org[1], org[2] + 16, 400 + (rand()&31), 0.1, 0); else if (state->effects & EF_DIMLIGHT) - CL_NewDlight (j, state->origin[0], state->origin[1], state->origin[2], 200 + (rand()&31), 0.1, 0); + CL_NewDlight (j, org[0], org[1], org[2], 200 + (rand()&31), 0.1, 0); } // the player object never gets added