]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - model_brush.c
added collision_prefernudgedfraction cvar (defaults to 1), which should improve colli...
[xonotic/darkplaces.git] / model_brush.c
index 75398747848c6a7b10abca21dfda967e9cfe4e59..8f907bfb7198aa289bfe6f8289eae5ac325dbbc9 100644 (file)
@@ -614,6 +614,7 @@ RecursiveHullCheckTraceInfo_t;
 #define HULLCHECKSTATE_SOLID 1
 #define HULLCHECKSTATE_DONE 2
 
+extern cvar_t collision_prefernudgedfraction;
 static int Mod_Q1BSP_RecursiveHullCheck(RecursiveHullCheckTraceInfo_t *t, int num, double p1f, double p2f, double p1[3], double p2[3])
 {
        // status variables, these don't need to be saved on the stack when
@@ -768,6 +769,9 @@ loc0:
        midf = (t1 - DIST_EPSILON) / (t1 - t2);
        t->trace->fraction = bound(0, midf, 1);
 
+       if (collision_prefernudgedfraction.integer)
+               t->trace->realfraction = t->trace->fraction;
+
 #if COLLISIONPARANOID >= 3
        Con_Print("D");
 #endif