// ==============
// main options
// ==============
-seta cl_physics default "client selected physics set"
+seta cl_physics "default" "client selected physics set"
set g_physics_clientselect 0 "allow clients to select their physics set"
set g_physics_clientselect_options "xonotic nexuiz quake warsow defrag quake3 vecxis quake2"
+set g_physics_clientselect_default "" "override default physics"
// =========
// Xonotic
float autocvar_g_spawn_near_teammate_ignore_spawnpoint_closetodeath;
float autocvar_g_physics_clientselect;
string autocvar_g_physics_clientselect_options;
+string autocvar_g_physics_clientselect_default;
float autocvar_g_buffs_waypoint_distance;
float autocvar_g_buffs_randomize;
float autocvar_g_buffs_random_lifetime;
// 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));