]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/bugrigs/bugrigs.qc
Remove engine side player movement prediction, and the extra mode without CSQC movety...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / bugrigs / bugrigs.qc
index 194341383dc2d5afd8c8cdf014c907c4bc3cc418..fbbe6035043af2fbfe6bc1a087d38f8e56f85961 100644 (file)
@@ -1,8 +1,8 @@
 #ifdef IMPLEMENTATION
 #ifdef SVQC
-       #include "../../../../server/antilag.qh"
+       #include <server/antilag.qh>
 #endif
-#include "../../../physics.qh"
+#include <common/physics/player.qh>
 
 
 #if defined(SVQC)
@@ -214,13 +214,13 @@ void RaceCarPhysics(entity this)
                }
 
                this.velocity = (neworigin - this.origin) * (1.0 / PHYS_INPUT_TIMELENGTH);
-               this.movetype = MOVETYPE_NOCLIP;
+               set_movetype(this, MOVETYPE_NOCLIP);
        }
        else
        {
                rigvel_z -= PHYS_INPUT_TIMELENGTH * PHYS_GRAVITY(this); // 4x gravity plays better
                this.velocity = rigvel;
-               this.movetype = MOVETYPE_FLY;
+               set_movetype(this, MOVETYPE_FLY);
        }
 
        trace_fraction = 1;
@@ -262,8 +262,6 @@ void RaceCarPhysics(entity this)
        smoothangles = vectoangles2(vf1, vu1);
        this.angles_x = -smoothangles_x;
        this.angles_z =  smoothangles_z;
-
-       PM_ClientMovement_Move(this);
 }
 
 #ifdef SVQC
@@ -271,43 +269,44 @@ void RaceCarPhysics(entity this)
 #endif
 MUTATOR_HOOKFUNCTION(bugrigs, PM_Physics)
 {
-       if(!PHYS_BUGRIGS(self) || !IS_PLAYER(self)) { return false; }
+    entity player = M_ARGV(0, entity);
+
+       if(!PHYS_BUGRIGS(player) || !IS_PLAYER(player)) { return; }
 
 #ifdef SVQC
-       self.angles = self.bugrigs_prevangles;
+       player.angles = player.bugrigs_prevangles;
 #endif
 
-       RaceCarPhysics(self);
+       RaceCarPhysics(player);
        return true;
 }
 
 MUTATOR_HOOKFUNCTION(bugrigs, PlayerPhysics)
 {
-       if(!PHYS_BUGRIGS(self)) { return false; }
+       if(!PHYS_BUGRIGS(M_ARGV(0, entity))) { return; }
 #ifdef SVQC
-       self.bugrigs_prevangles = self.angles;
+       entity player = M_ARGV(0, entity);
+       player.bugrigs_prevangles = player.angles;
 #endif
-       return false;
 }
 
 #ifdef SVQC
 
 MUTATOR_HOOKFUNCTION(bugrigs, ClientConnect)
 {
-       stuffcmd(self, "cl_cmd settemp chase_active 1\n");
-       return false;
+    entity player = M_ARGV(0, entity);
+
+       stuffcmd(player, "cl_cmd settemp chase_active 1\n");
 }
 
 MUTATOR_HOOKFUNCTION(bugrigs, BuildMutatorsString)
 {
-       ret_string = strcat(ret_string, ":bugrigs");
-       return false;
+       M_ARGV(0, string) = strcat(M_ARGV(0, string), ":bugrigs");
 }
 
 MUTATOR_HOOKFUNCTION(bugrigs, BuildMutatorsPrettyString)
 {
-       ret_string = strcat(ret_string, ", Bug rigs");
-       return false;
+       M_ARGV(0, string) = strcat(M_ARGV(0, string), ", Bug rigs");
 }
 
 #endif