dlight_t *dl;
float time, f;
- time = cl.time - cl.oldtime;
+ time = bound(0, cl.time - cl.oldtime, 0.1);
oldmax = cl.num_dlights;
cl.num_dlights = 0;
for (i = 0, dl = cl.dlights;i < oldmax;i++, dl++)
dlightcolor[2] += 1.50f;
}
if (e->render.effects & EF_FLAME)
- CL_ParticleEffect(EFFECT_EF_FLAME, cl.time - cl.oldtime, origin, origin, vec3_origin, vec3_origin, NULL, 0);
+ CL_ParticleEffect(EFFECT_EF_FLAME, bound(0, cl.time - cl.oldtime, 0.1), origin, origin, vec3_origin, vec3_origin, NULL, 0);
if (e->render.effects & EF_STARDUST)
- CL_ParticleEffect(EFFECT_EF_STARDUST, cl.time - cl.oldtime, origin, origin, vec3_origin, vec3_origin, NULL, 0);
+ CL_ParticleEffect(EFFECT_EF_STARDUST, bound(0, cl.time - cl.oldtime, 0.1), origin, origin, vec3_origin, vec3_origin, NULL, 0);
if (e->render.effects & (EF_FLAG1QW | EF_FLAG2QW))
{
// these are only set on player entities
tempmatrix = e->render.matrix;
Matrix4x4_SetOrigin(&tempmatrix, trace.endpos[0], trace.endpos[1], trace.endpos[2]);
CL_AllocDlight(NULL, &tempmatrix, 100, e->persistent.muzzleflash, e->persistent.muzzleflash, e->persistent.muzzleflash, 0, 0, 0, -1, true, 0, 0.25, 0.25, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
- e->persistent.muzzleflash -= (cl.time - cl.oldtime) * 10;
+ e->persistent.muzzleflash -= bound(0, cl.time - cl.oldtime, 0.1) * 10;
}
// LordHavoc: if the model has no flags, don't check each
if (e->render.model && e->render.model->flags && (!e->state_current.tagentity && !(e->render.flags & RENDER_VIEWMODEL)))
void CL_StairSmoothing (void)
{
if (v_dmg_time > 0)
- v_dmg_time -= (cl.time - cl.oldtime);
+ v_dmg_time -= bound(0, cl.time - cl.oldtime, 0.1);
// stair smoothing
if (cl.onground && cl.stairoffset < 0)
{
- cl.stairoffset += (cl.time - cl.oldtime) * cl_stairsmoothspeed.value;
+ cl.stairoffset += bound(0, cl.time - cl.oldtime, 0.1) * cl_stairsmoothspeed.value;
cl.stairoffset = bound(-16, cl.stairoffset, 0);
}
else if (cl.onground && cl.stairoffset > 0)
{
- cl.stairoffset -= (cl.time - cl.oldtime) * cl_stairsmoothspeed.value;
+ cl.stairoffset -= bound(0, cl.time - cl.oldtime, 0.1) * cl_stairsmoothspeed.value;
cl.stairoffset = bound(0, cl.stairoffset, 16);
}
else
void V_FadeViewFlashs(void)
{
+ // don't flash if time steps backwards
+ if (cl.time <= cl.oldtime)
+ return;
// drop the damage value
cl.cshifts[CSHIFT_DAMAGE].percent -= (cl.time - cl.oldtime)*150;
if (cl.cshifts[CSHIFT_DAMAGE].percent <= 0)