]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - clvm_cmds.c
Merge branch 'master' into Mario/wrath-darkplaces_extra
[xonotic/darkplaces.git] / clvm_cmds.c
index 68080dea377fbda6bb15c20f065d2b0664e1d9f7..4a2e60cbd6506b440a8a2adc1bedf7a56057e220 100644 (file)
@@ -590,12 +590,13 @@ static void VM_CL_checkbottom (prvm_prog_t *prog)
        vec3_t                  mins, maxs, start, stop;
        trace_t                 trace;
        int                             x, y;
-       float                   mid, bottom;
+       float                   mid, bottom, stepheight;
 
        VM_SAFEPARMCOUNT(1, VM_CL_checkbottom);
        ent = PRVM_G_EDICT(OFS_PARM0);
        PRVM_G_FLOAT(OFS_RETURN) = 0;
 
+       stepheight = sv_stepheight.value + PRVM_clientedictfloat(ent, stepheight_delta);
        VectorAdd (PRVM_clientedictvector(ent, origin), PRVM_clientedictvector(ent, mins), mins);
        VectorAdd (PRVM_clientedictvector(ent, origin), PRVM_clientedictvector(ent, maxs), maxs);
 
@@ -626,7 +627,7 @@ realcheck:
 // the midpoint must be within 16 of the bottom
        start[0] = stop[0] = (mins[0] + maxs[0])*0.5;
        start[1] = stop[1] = (mins[1] + maxs[1])*0.5;
-       stop[2] = start[2] - 2*sv_stepheight.value;
+       stop[2] = start[2] - 2*stepheight;
        trace = CL_TraceLine(start, stop, MOVE_NORMAL, ent, CL_GenericHitSuperContentsMask(ent), 0, 0, collision_extendmovelength.value, true, true, NULL, true, false);
 
        if (trace.fraction == 1.0)
@@ -645,7 +646,7 @@ realcheck:
 
                        if (trace.fraction != 1.0 && trace.endpos[2] > bottom)
                                bottom = trace.endpos[2];
-                       if (trace.fraction == 1.0 || mid - trace.endpos[2] > sv_stepheight.value)
+                       if (trace.fraction == 1.0 || mid - trace.endpos[2] > stepheight)
                                return;
                }
 
@@ -3435,8 +3436,9 @@ static qboolean CL_CheckBottom (prvm_edict_t *ent)
        vec3_t  mins, maxs, start, stop;
        trace_t trace;
        int             x, y;
-       float   mid, bottom;
+       float   mid, bottom, stepheight;
 
+       stepheight = sv_stepheight.value + PRVM_clientedictfloat(ent, stepheight_delta);
        VectorAdd (PRVM_clientedictvector(ent, origin), PRVM_clientedictvector(ent, mins), mins);
        VectorAdd (PRVM_clientedictvector(ent, origin), PRVM_clientedictvector(ent, maxs), maxs);
 
@@ -3464,7 +3466,7 @@ realcheck:
 // the midpoint must be within 16 of the bottom
        start[0] = stop[0] = (mins[0] + maxs[0])*0.5;
        start[1] = stop[1] = (mins[1] + maxs[1])*0.5;
-       stop[2] = start[2] - 2*sv_stepheight.value;
+       stop[2] = start[2] - 2*stepheight;
        trace = CL_TraceLine(start, stop, MOVE_NOMONSTERS, ent, CL_GenericHitSuperContentsMask(ent), 0, 0, collision_extendmovelength.value, true, false, NULL, true, false);
 
        if (trace.fraction == 1.0)
@@ -3482,7 +3484,7 @@ realcheck:
 
                        if (trace.fraction != 1.0 && trace.endpos[2] > bottom)
                                bottom = trace.endpos[2];
-                       if (trace.fraction == 1.0 || mid - trace.endpos[2] > sv_stepheight.value)
+                       if (trace.fraction == 1.0 || mid - trace.endpos[2] > stepheight)
                                return false;
                }
 
@@ -3501,13 +3503,15 @@ possible, no move is done and false is returned
 static qboolean CL_movestep (prvm_edict_t *ent, vec3_t move, qboolean relink, qboolean noenemy, qboolean settrace)
 {
        prvm_prog_t *prog = CLVM_prog;
-       float           dz;
+       float           dz, stepheight;
        vec3_t          oldorg, neworg, end, traceendpos;
        vec3_t          mins, maxs, start;
        trace_t         trace;
        int                     i, svent;
        prvm_edict_t            *enemy;
 
+       stepheight = sv_stepheight.value + PRVM_clientedictfloat(ent, stepheight_delta);
+
 // try the move
        VectorCopy(PRVM_clientedictvector(ent, mins), mins);
        VectorCopy(PRVM_clientedictvector(ent, maxs), maxs);
@@ -3555,9 +3559,9 @@ static qboolean CL_movestep (prvm_edict_t *ent, vec3_t move, qboolean relink, qb
        }
 
 // push down from a step height above the wished position
-       neworg[2] += sv_stepheight.value;
+       neworg[2] += stepheight;
        VectorCopy (neworg, end);
-       end[2] -= sv_stepheight.value*2;
+       end[2] -= stepheight*2;
 
        trace = CL_TraceBox(neworg, mins, maxs, end, MOVE_NORMAL, ent, CL_GenericHitSuperContentsMask(ent), 0, 0, collision_extendmovelength.value, true, true, &svent, true);
        if (settrace)
@@ -3565,7 +3569,7 @@ static qboolean CL_movestep (prvm_edict_t *ent, vec3_t move, qboolean relink, qb
 
        if (trace.startsolid)
        {
-               neworg[2] -= sv_stepheight.value;
+               neworg[2] -= stepheight;
                trace = CL_TraceBox(neworg, mins, maxs, end, MOVE_NORMAL, ent, CL_GenericHitSuperContentsMask(ent), 0, 0, collision_extendmovelength.value, true, true, &svent, true);
                if (settrace)
                        CL_VM_SetTraceGlobals(prog, &trace, svent);
@@ -4809,6 +4813,114 @@ VM_digest_hex,                                          // #639
 VM_CL_V_CalcRefdef,                                    // #640 void(entity e) V_CalcRefdef (DP_CSQC_V_CALCREFDEF)
 NULL,                                                  // #641
 VM_coverage,                                           // #642
+NULL,                                          // #643
+NULL,                                          // #644
+NULL,                                          // #645
+NULL,                                          // #646
+NULL,                                          // #647
+NULL,                                          // #648
+NULL,                                          // #649
+// WRATH range (#650-#???)
+VM_fcopy,                                      // #650 float(string fnfrom, string fnto) fcopy (EXT_WRATH)
+VM_frename,                                    // #651 float (string fnold, string fnnew) frename (EXT_WRATH)
+VM_fremove,                                    // #652 float (string fname) fremove (EXT_WRATH)
+VM_fexists,                                    // #653 float (string fname) fexists (EXT_WRATH)
+VM_rmtree,                                     // #654 float (string path) rmtree (EXT_WRATH)
+NULL,                                          // #655
+NULL,                                          // #656
+NULL,                                          // #657
+NULL,                                          // #658
+NULL,                                          // #659
+NULL,                                          // #660
+NULL,                                          // #661
+NULL,                                          // #662
+NULL,                                          // #663
+NULL,                                          // #664
+NULL,                                          // #665
+NULL,                                          // #666
+NULL,                                          // #667
+NULL,                                          // #668
+NULL,                                          // #669
+NULL,                                          // #670
+NULL,                                          // #671
+NULL,                                          // #672
+NULL,                                          // #673
+NULL,                                          // #674
+NULL,                                          // #675
+NULL,                                          // #676
+NULL,                                          // #677
+NULL,                                          // #678
+NULL,                                          // #679
+NULL,                                          // #680
+NULL,                                          // #681
+NULL,                                          // #682
+NULL,                                          // #683
+NULL,                                          // #684
+NULL,                                          // #685
+NULL,                                          // #686
+NULL,                                          // #687
+NULL,                                          // #688
+NULL,                                          // #689
+NULL,                                          // #690
+NULL,                                          // #691
+NULL,                                          // #692
+NULL,                                          // #693
+NULL,                                          // #694
+NULL,                                          // #695
+NULL,                                          // #696
+NULL,                                          // #697
+NULL,                                          // #698
+NULL,                                          // #699
+NULL,                                          // #700
+NULL,                                          // #701
+NULL,                                          // #702
+NULL,                                          // #703
+NULL,                                          // #704
+NULL,                                          // #705
+NULL,                                          // #706
+NULL,                                          // #707
+NULL,                                          // #708
+NULL,                                          // #709
+NULL,                                          // #710
+NULL,                                          // #711
+NULL,                                          // #712
+NULL,                                          // #713
+NULL,                                          // #714
+NULL,                                          // #715
+NULL,                                          // #716
+NULL,                                          // #717
+NULL,                                          // #718
+NULL,                                          // #719
+NULL,                                          // #720
+NULL,                                          // #721
+NULL,                                          // #722
+NULL,                                          // #723
+NULL,                                          // #724
+NULL,                                          // #725
+NULL,                                          // #726
+NULL,                                          // #727
+NULL,                                          // #728
+NULL,                                          // #729
+NULL,                                          // #730
+NULL,                                          // #731
+NULL,                                          // #732
+NULL,                                          // #733
+NULL,                                          // #734
+NULL,                                          // #735
+NULL,                                          // #736
+NULL,                                          // #737
+NULL,                                          // #738
+NULL,                                          // #739
+NULL,                                          // #740
+NULL,                                          // #741
+NULL,                                          // #742
+NULL,                                          // #743
+NULL,                                          // #744
+NULL,                                          // #745
+NULL,                                          // #746
+NULL,                                          // #747
+NULL,                                          // #748
+NULL,                                          // #749
 NULL
 };