diff --git a/engine/client/cl_ents.c b/engine/client/cl_ents.c index 4686208d8..a5adb6154 100644 --- a/engine/client/cl_ents.c +++ b/engine/client/cl_ents.c @@ -1597,8 +1597,8 @@ void CL_LinkPacketEntities (void) VectorCopy(le->origin, ent->origin) - //bots or powerup glows. Bots always glow, powerups can be disabled - if (state->modelindex != cl_playerindex && r_powerupglow.value) + //bots or powerup glows. items always glow, powerups can be disabled + if (state->modelindex != cl_playerindex || r_powerupglow.value) { flicker = r_lightflicker.value?(rand()&31):0; // spawn light flashes, even ones coming from invisible objects @@ -1900,8 +1900,8 @@ void CL_LinkPacketEntities (void) ent->origin[i] = cl.lerpents[s1->number].origin[i] + f * (s1->origin[i] - cl.lerpents[s1->number].origin[i]); - //bots or powerup glows. Bots always glow, powerups can be disabled - if (s1->modelindex != cl_playerindex && r_powerupglow.value) + //bots or powerup glows. items always glow, powerups can be disabled + if (s1->modelindex != cl_playerindex || r_powerupglow.value) { flicker = r_lightflicker.value?(rand()&31):0; // spawn light flashes, even ones coming from invisible objects @@ -2709,6 +2709,7 @@ void CL_LinkPlayers (void) frame_t *fromf; int oldphysent; vec3_t angles; + float *org; playertime = realtime - cls.latency + 0.02; if (playertime > realtime) @@ -2724,18 +2725,20 @@ void CL_LinkPlayers (void) continue; // not present this frame // spawn light flashes, even ones coming from invisible objects - if ((!r_flashblend.value || j != cl.playernum[0]) && r_powerupglow.value) + if (r_powerupglow.value && !(r_powerupglow.value == 2 && j == cl.playernum[0])) { + org = (j == cl.playernum[0]) ? cl.simorg[0] : state->origin; + if ((state->effects & (EF_BLUE | EF_RED)) == (EF_BLUE | EF_RED)) - CL_NewDlight (j+1, state->origin[0], state->origin[1], state->origin[2], 200 + (r_lightflicker.value?(rand()&31):0), 0.1, 3)->noppl = (j != cl.playernum[0]); + CL_NewDlight (j+1, org[0], org[1], org[2], 200 + (r_lightflicker.value?(rand()&31):0), 0.1, 3)->noppl = (j != cl.playernum[0]); else if (state->effects & EF_BLUE) - CL_NewDlight (j+1, state->origin[0], state->origin[1], state->origin[2], 200 + (r_lightflicker.value?(rand()&31):0), 0.1, 1)->noppl = (j != cl.playernum[0]); + CL_NewDlight (j+1, org[0], org[1], org[2], 200 + (r_lightflicker.value?(rand()&31):0), 0.1, 1)->noppl = (j != cl.playernum[0]); else if (state->effects & EF_RED) - CL_NewDlight (j+1, state->origin[0], state->origin[1], state->origin[2], 200 + (r_lightflicker.value?(rand()&31):0), 0.1, 2)->noppl = (j != cl.playernum[0]); + CL_NewDlight (j+1, org[0], org[1], org[2], 200 + (r_lightflicker.value?(rand()&31):0), 0.1, 2)->noppl = (j != cl.playernum[0]); else if (state->effects & EF_BRIGHTLIGHT) - CL_NewDlight (j+1, state->origin[0], state->origin[1], state->origin[2] + 16, 400 + (r_lightflicker.value?(rand()&31):0), 0.1, 0)->noppl = (j != cl.playernum[0]); + CL_NewDlight (j+1, org[0], org[1], org[2] + 16, 400 + (r_lightflicker.value?(rand()&31):0), 0.1, 0)->noppl = (j != cl.playernum[0]); else if (state->effects & EF_DIMLIGHT) - CL_NewDlight (j+1, state->origin[0], state->origin[1], state->origin[2], 200 + (r_lightflicker.value?(rand()&31):0), 0.1, 0)->noppl = (j != cl.playernum[0]); + CL_NewDlight (j+1, org[0], org[1], org[2], 200 + (r_lightflicker.value?(rand()&31):0), 0.1, 0)->noppl = (j != cl.playernum[0]); } if (state->modelindex < 1) diff --git a/engine/client/cl_parse.c b/engine/client/cl_parse.c index d023b4010..694352e11 100644 --- a/engine/client/cl_parse.c +++ b/engine/client/cl_parse.c @@ -3244,7 +3244,7 @@ void CL_MuzzleFlash (int destsplit) if (s1->number == i) { - dl = CL_AllocDlight (i); + dl = CL_AllocDlight (-i); VectorCopy (s1->origin, dl->origin); break; } @@ -3253,13 +3253,9 @@ void CL_MuzzleFlash (int destsplit) { //that ent number doesn't exist, go for a player with that number if ((unsigned)(i) <= MAX_CLIENTS && i > 0) { - // don't draw our own muzzle flash in gl if flashblending - if (i-1 == cl.playernum[destsplit] && r_flashblend.value && qrenderer == QR_OPENGL) - return; - pl = &cl.frames[parsecountmod].playerstate[i-1]; - dl = CL_AllocDlight (i); + dl = CL_AllocDlight (-i); VectorCopy (pl->origin, dl->origin); //set it's origin AngleVectors (pl->viewangles, fv, rv, uv); //shift it up a little diff --git a/engine/gl/gl_rlight.c b/engine/gl/gl_rlight.c index 0bb4056b6..1d286e22e 100644 --- a/engine/gl/gl_rlight.c +++ b/engine/gl/gl_rlight.c @@ -190,6 +190,12 @@ void GLR_RenderDlights (void) if (!l->radius || l->noflash) continue; + //dlights emitting from the local player are not visible as flashblends + if (l->key == cl.playernum[r_refdef.currentplayernum]+1) + continue; //was a glow + if (l->key == -(cl.playernum[r_refdef.currentplayernum]+1)) + continue; //was a muzzleflash + if (r_flashblend.value == 2) { if (TraceLineN(r_refdef.vieworg, l->origin, waste1, waste2))