From: Mario Date: Sat, 13 May 2017 04:55:31 +0000 (+1000) Subject: Attempt to speed up physics client option selection by checking for empty and default... X-Git-Tag: xonotic-v0.8.5~2787 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=be7c94a86b1c3d9ce932d7d5dc953ddc5443f3c1;p=xonotic%2Fxonotic-data.pk3dir.git Attempt to speed up physics client option selection by checking for empty and default settings --- diff --git a/qcsrc/common/physics/player.qc b/qcsrc/common/physics/player.qc index b108aa92b..c4ad8d2eb 100644 --- a/qcsrc/common/physics/player.qc +++ b/qcsrc/common/physics/player.qc @@ -10,20 +10,20 @@ // client side physics bool Physics_Valid(string thecvar) { - return autocvar_g_physics_clientselect && strhasword(autocvar_g_physics_clientselect_options, thecvar); + return autocvar_g_physics_clientselect && thecvar != "" && thecvar && && thecvar != "default" strhasword(autocvar_g_physics_clientselect_options, thecvar); } float Physics_ClientOption(entity this, string option, float defaultval) { if(IS_REAL_CLIENT(this) && Physics_Valid(this.cvar_cl_physics)) { - string s = sprintf("g_physics_%s_%s", this.cvar_cl_physics, option); + string s = strcat("g_physics_", this.cvar_cl_physics, "_", option); if(cvar_type(s) & CVAR_TYPEFLAG_EXISTS) return cvar(s); } if(autocvar_g_physics_clientselect && autocvar_g_physics_clientselect_default) { - string s = sprintf("g_physics_%s_%s", autocvar_g_physics_clientselect_default, option); + string s = strcat("g_physics_", autocvar_g_physics_clientselect_default, "_", option); if(cvar_type(s) & CVAR_TYPEFLAG_EXISTS) return cvar(s); }