]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_physics.qc
Merge branch 'master' into Mario/physics
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_physics.qc
index 81c3cfd8b2719b9a66fd837950b210c6c9cd45fd..37242874e8c5c5f7ce926584424e31e5b89e2de8 100644 (file)
@@ -1,3 +1,7 @@
+#include "_all.qh"
+#include "bot/bot.qh"
+#include "g_damage.qh"
+
 #if defined(CSQC)
 #elif defined(MENUQC)
 #elif defined(SVQC)
@@ -9,7 +13,7 @@
     #include "../common/util.qh"
     #include "../common/animdecide.qh"
     #include "../common/monsters/sv_monsters.qh"
-    #include "../common/weapons/weapons.qh"
+    #include "../common/weapons/all.qh"
     #include "t_items.qh"
     #include "autocvars.qh"
     #include "defs.qh"
 // client side physics
 float Physics_Valid(string thecvar)
 {
-       if(!autocvar_g_physics_clientselect) { return FALSE; }
+       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 true;
 
-       return FALSE;
+       return false;
 }
 
 float Physics_ClientOption(entity pl, string option)
 {
-       if (Physics_Valid(pl.cvar_cl_physics))
+       if(Physics_Valid(pl.cvar_cl_physics))
        {
                string var = sprintf("g_physics_%s_%s", pl.cvar_cl_physics, option);
-               if (cvar_type(var) & 1)
+               if(cvar_type(var) & 1)
+                       return cvar(var);
+       }
+       if(autocvar_g_physics_clientselect && autocvar_g_physics_clientselect_default)
+       {
+               string var = sprintf("g_physics_%s_%s", autocvar_g_physics_clientselect_default, option);
+               if(cvar_type(var) & 1)
                        return cvar(var);
        }
        return cvar(strcat("sv_", option));
@@ -683,32 +693,6 @@ void SpecialCommand()
 #endif
 }
 
-float speedaward_speed;
-string speedaward_holder;
-string speedaward_uid;
-void race_send_speedaward(float msg)
-{
-       // send the best speed of the round
-       WriteByte(msg, SVC_TEMPENTITY);
-       WriteByte(msg, TE_CSQC_RACE);
-       WriteByte(msg, RACE_NET_SPEED_AWARD);
-       WriteInt24_t(msg, floor(speedaward_speed+0.5));
-       WriteString(msg, speedaward_holder);
-}
-
-float speedaward_alltimebest;
-string speedaward_alltimebest_holder;
-string speedaward_alltimebest_uid;
-void race_send_speedaward_alltimebest(float msg)
-{
-       // send the best speed
-       WriteByte(msg, SVC_TEMPENTITY);
-       WriteByte(msg, TE_CSQC_RACE);
-       WriteByte(msg, RACE_NET_SPEED_AWARD_BEST);
-       WriteInt24_t(msg, floor(speedaward_alltimebest+0.5));
-       WriteString(msg, speedaward_alltimebest_holder);
-}
-
 string GetMapname(void);
 float speedaward_lastupdate;
 float speedaward_lastsent;