]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/physics.qc
Entity debugger
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / physics.qc
index cb823b1074c8ee19ed2048831b5e2b7f5d82cb89..b3954d2eefd8cead759f5cde23e747fc8b463a64 100644 (file)
@@ -1,6 +1,5 @@
 #include "physics.qh"
-#include "triggers/trigger/swamp.qh"
-#include "triggers/trigger/jumppads.qh"
+#include "triggers/include.qh"
 #include "viewloc.qh"
 
 #ifdef SVQC
 // client side physics
 bool Physics_Valid(string thecvar)
 {
-       if(!autocvar_g_physics_clientselect) { return false; }
-
-       string l = strcat(" ", autocvar_g_physics_clientselect_options, " ");
-
-       if(strstrofs(l, strcat(" ", thecvar, " "), 0) >= 0)
-               return true;
-
-       return false;
+       return autocvar_g_physics_clientselect && strhasword(autocvar_g_physics_clientselect_options, thecvar);
 }
 
 float Physics_ClientOption(entity pl, string option)
@@ -983,17 +975,6 @@ void SpecialCommand()
 #endif
 }
 
-void PM_check_race_movetime(void)
-{SELFPARAM();
-#ifdef SVQC
-       self.race_movetime_frac += PHYS_INPUT_TIMELENGTH;
-       float f = floor(self.race_movetime_frac);
-       self.race_movetime_frac -= f;
-       self.race_movetime_count += f;
-       self.race_movetime = self.race_movetime_frac + self.race_movetime_count;
-#endif
-}
-
 float PM_check_specialcommand(float buttons)
 {SELFPARAM();
 #ifdef SVQC
@@ -1153,40 +1134,6 @@ void PM_check_blocked(void)
 #endif
 }
 
-#ifdef SVQC
-float speedaward_lastsent;
-float speedaward_lastupdate;
-#endif
-void PM_check_race(void)
-{SELFPARAM();
-#ifdef SVQC
-       if(!(g_cts || g_race))
-               return;
-       if (vlen(self.velocity - self.velocity_z * '0 0 1') > speedaward_speed)
-       {
-               speedaward_speed = vlen(self.velocity - self.velocity_z * '0 0 1');
-               speedaward_holder = self.netname;
-               speedaward_uid = self.crypto_idfp;
-               speedaward_lastupdate = time;
-       }
-       if (speedaward_speed > speedaward_lastsent && time - speedaward_lastupdate > 1)
-       {
-               string rr = (g_cts) ? CTS_RECORD : RACE_RECORD;
-               race_send_speedaward(MSG_ALL);
-               speedaward_lastsent = speedaward_speed;
-               if (speedaward_speed > speedaward_alltimebest && speedaward_uid != "")
-               {
-                       speedaward_alltimebest = speedaward_speed;
-                       speedaward_alltimebest_holder = speedaward_holder;
-                       speedaward_alltimebest_uid = speedaward_uid;
-                       db_put(ServerProgsDB, strcat(GetMapname(), rr, "speed/speed"), ftos(speedaward_alltimebest));
-                       db_put(ServerProgsDB, strcat(GetMapname(), rr, "speed/crypto_idfp"), speedaward_alltimebest_uid);
-                       race_send_speedaward_alltimebest(MSG_ALL);
-               }
-       }
-#endif
-}
-
 void PM_check_vortex(void)
 {SELFPARAM();
 #ifdef SVQC
@@ -1683,7 +1630,6 @@ void PM_Main()
                        return;
 #endif
 
-       PM_check_race_movetime();
 #ifdef SVQC
        anticheat_physics();
 #endif
@@ -1716,17 +1662,7 @@ void PM_Main()
        if (IS_PLAYER(self))
 #endif
        {
-#ifdef SVQC
-               if (self.race_penalty)
-                       if (time > self.race_penalty)
-                               self.race_penalty = 0;
-#endif
-
                bool not_allowed_to_move = false;
-#ifdef SVQC
-               if (self.race_penalty)
-                       not_allowed_to_move = true;
-#endif
 #ifdef SVQC
                if (time < game_starttime)
                        not_allowed_to_move = true;
@@ -1901,10 +1837,6 @@ void PM_Main()
        else
                PM_air(buttons_prev, maxspeed_mod);
 
-#ifdef SVQC
-       if (!IS_OBSERVER(self))
-               PM_check_race();
-#endif
        PM_check_vortex();
 
 :end