]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/movelib.qc
Merge remote-tracking branch 'origin/Mario/arena_nuke'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / movelib.qc
index dd3f43f9fe6549ce4dbe1ed8344603746e192c8c..de82b16a8ab1f793623514e24cb38639430deb4f 100644 (file)
@@ -1,3 +1,4 @@
+#ifdef SVQC
 .vector moveto;
 
 /**
@@ -89,10 +90,10 @@ void movelib_move(vector force,float max_velocity,float drag,float theMass,float
     if (self.waterlevel > 1)
     {
         self.velocity = self.velocity + force * (acceleration * deltatime);
-        self.velocity = self.velocity + '0 0 0.05' * sv_gravity * deltatime;
+        self.velocity = self.velocity + '0 0 0.05' * autocvar_sv_gravity * deltatime;
     }
     else
-        self.velocity = self.velocity + '0 0 -1' * sv_gravity * deltatime;
+        self.velocity = self.velocity + '0 0 -1' * autocvar_sv_gravity * deltatime;
 
     mspeed = vlen(self.velocity);
 
@@ -137,7 +138,7 @@ void movelib_update(vector dir,float force)
     old_speed    = vlen(self.velocity);
     old_dir      = normalize(self.velocity);
 
-    //ggravity      =  (sv_gravity / self.mass) * '0 0 100';
+    //ggravity      =  (autocvar_sv_gravity / self.mass) * '0 0 100';
     acceleration =  (force / self.mass) * dir;
     //acceleration -= old_dir * (old_speed / self.mass);
     acceleration -= ggravity;
@@ -161,10 +162,14 @@ void movelib_update(vector dir,float force)
 }
 */
 
+/*
 void movelib_move_simple(vector newdir,float velo,float blendrate)
 {
     self.velocity = self.velocity * (1 - blendrate) + (newdir * blendrate) * velo;
 }
+*/
+#define movelib_move_simple(newdir,velo,blendrate) \
+    self.velocity = self.velocity * (1 - blendrate) + (newdir * blendrate) * velo
 
 void movelib_beak_simple(float force)
 {
@@ -183,7 +188,9 @@ void movelib_beak_simple(float force)
 Pitches and rolls the entity to match the gound.
 Yed need to set v_up and v_forward (generally by calling makevectors) before calling this.
 **/
-void movelib_groundalign4point(float spring_length, float spring_up, float blendrate)
+#endif
+
+void movelib_groundalign4point(float spring_length, float spring_up, float blendrate, float _max)
 {
     vector a, b, c, d, e, r, push_angle, ahead, side;
 
@@ -220,11 +227,11 @@ void movelib_groundalign4point(float spring_length, float spring_up, float blend
     r = self.origin;
     r_z = r_z;
 
-    push_angle_x = (a_z - c_z) * 45;
-    push_angle_x += (b_z - d_z) * 45;
+    push_angle_x = (a_z - c_z) * _max;
+    push_angle_x += (b_z - d_z) * _max;
 
-    push_angle_z = (b_z - a_z) * 45;
-    push_angle_z += (d_z - c_z) * 45;
+    push_angle_z = (b_z - a_z) * _max;
+    push_angle_z += (d_z - c_z) * _max;
 
     //self.angles_x += push_angle_x * 0.95;
     //self.angles_z += push_angle_z * 0.95;