From: Mario Date: Thu, 9 Jul 2015 07:39:06 +0000 (+1000) Subject: Fix hardcoded constant values for cvar_type X-Git-Tag: xonotic-v0.8.1~48^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=26c5de33df1a8ee5beb57383f9b2dc72f51d6064;p=xonotic%2Fxonotic-data.pk3dir.git Fix hardcoded constant values for cvar_type --- diff --git a/qcsrc/server/cl_physics.qc b/qcsrc/server/cl_physics.qc index 37242874e..14747d156 100644 --- a/qcsrc/server/cl_physics.qc +++ b/qcsrc/server/cl_physics.qc @@ -58,13 +58,13 @@ float Physics_ClientOption(entity pl, string option) 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) & CVAR_TYPEFLAG_EXISTS) 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) + if(cvar_type(var) & CVAR_TYPEFLAG_EXISTS) return cvar(var); } return cvar(strcat("sv_", option)); diff --git a/qcsrc/server/miscfunctions.qh b/qcsrc/server/miscfunctions.qh index 3acc88360..b9ae44be9 100644 --- a/qcsrc/server/miscfunctions.qh +++ b/qcsrc/server/miscfunctions.qh @@ -15,7 +15,7 @@ #else string cvar_string_normal(string n) { - if (!(cvar_type(n) & 1)) + if (!(cvar_type(n) & CVAR_TYPEFLAG_EXISTS)) backtrace(strcat("Attempt to access undefined cvar: ", n)); return builtin_cvar_string(n); }