]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_physics.qc
Add an option to override the default physics set (useful for using cvar based physic...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_physics.qc
index 81c3cfd8b2719b9a66fd837950b210c6c9cd45fd..574d7f54b53fa0c9a38a64853bd5b8fb1735a4ac 100644 (file)
 // 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));