]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_rmain.c
validate r_shadow_frontsidecasting each frame and correct it to a valid
[xonotic/darkplaces.git] / gl_rmain.c
index 2a2bb92974febb5dca3496356d06d071b6684396..72831d8775a9dfb1e43c10a4fdd11e9cbbd86767 100644 (file)
@@ -2453,6 +2453,8 @@ void R_UpdateVariables(void)
                r_refdef.farclip += VectorDistance(r_refdef.worldmodel->normalmins, r_refdef.worldmodel->normalmaxs);
        r_refdef.nearclip = bound (0.001f, r_nearclip.value, r_refdef.farclip - 1.0f);
 
+       if (r_shadow_frontsidecasting.integer < 0 || r_shadow_frontsidecasting.integer > 1)
+               Cvar_SetValueQuick(&r_shadow_frontsidecasting, 1);
        r_refdef.polygonfactor = 0;
        r_refdef.polygonoffset = 0;
        r_refdef.shadowpolygonfactor = r_refdef.polygonfactor + r_shadow_shadow_polygonfactor.value * (r_shadow_frontsidecasting.integer ? 1 : -1);