]> 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 c3e9130db6390f588f39efc210036819f2462bac..4d412bd9e3581369d8420522e04df052c13736e1 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;
                }
 
@@ -1215,7 +1216,7 @@ void VM_drawline (prvm_prog_t *prog)
        rgb             = PRVM_G_VECTOR(OFS_PARM3);
        alpha   = PRVM_G_FLOAT(OFS_PARM4);
        flags   = (int)PRVM_G_FLOAT(OFS_PARM5);
-       DrawQ_Line(width, c1[0], c1[1], c2[0], c2[1], rgb[0], rgb[1], rgb[2], alpha, flags, false);
+       DrawQ_Line(width, c1[0], c1[1], c2[0], c2[1], rgb[0], rgb[1], rgb[2], alpha, flags);
 }
 
 /*
@@ -2402,7 +2403,7 @@ static void VM_CL_setlistener (prvm_prog_t *prog)
 static void VM_CL_registercmd (prvm_prog_t *prog)
 {
        VM_SAFEPARMCOUNT(1, VM_CL_registercmd);
-       if(!Cmd_Exists(&cmd_client, PRVM_G_STRING(OFS_PARM0)))
+       if(!Cmd_Exists(cmd_local, PRVM_G_STRING(OFS_PARM0)))
                Cmd_AddCommand(CF_CLIENT, PRVM_G_STRING(OFS_PARM0), NULL, "console command created by QuakeC");
 }
 
@@ -4210,8 +4211,9 @@ static qbool 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);
 
@@ -4239,7 +4241,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)
@@ -4257,7 +4259,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;
                }
 
@@ -4276,13 +4278,15 @@ possible, no move is done and false is returned
 static qbool CL_movestep (prvm_edict_t *ent, vec3_t move, qbool relink, qbool noenemy, qbool 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);
@@ -4330,9 +4334,9 @@ static qbool CL_movestep (prvm_edict_t *ent, vec3_t move, qbool relink, qbool no
        }
 
 // 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)
@@ -4340,7 +4344,7 @@ static qbool CL_movestep (prvm_edict_t *ent, vec3_t move, qbool relink, qbool no
 
        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);
@@ -4982,7 +4986,7 @@ NULL,                                                     // #42 (QUAKE)
 VM_fabs,                                               // #43 float(float f) fabs (QUAKE)
 NULL,                                                  // #44 vector(entity e, float speed) aim (QUAKE)
 VM_cvar,                                               // #45 float(string s) cvar (QUAKE)
-VM_localcmd_client,                            // #46 void(string s) localcmd (QUAKE)
+VM_localcmd_local,                             // #46 void(string s) localcmd (QUAKE)
 VM_nextent,                                            // #47 entity(entity e) nextent (QUAKE)
 VM_CL_particle,                                        // #48 void(vector o, vector d, float color, float count) particle (QUAKE)
 VM_changeyaw,                                  // #49 void() ChangeYaw (QUAKE)
@@ -5583,6 +5587,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
 };