From: Mario Date: Thu, 18 Jan 2018 12:50:10 +0000 (+1000) Subject: Attempt to optimise physics valid checking by using a custom word checker X-Git-Tag: xonotic-v0.8.5~2385 X-Git-Url: http://de.git.xonotic.org/?a=commitdiff_plain;h=982c9de4043d84a15eeb0f78bed781a37c1af940;p=xonotic%2Fxonotic-data.pk3dir.git Attempt to optimise physics valid checking by using a custom word checker --- diff --git a/qcsrc/common/physics/player.qc b/qcsrc/common/physics/player.qc index 20c580a85..ae8ffa3fe 100644 --- a/qcsrc/common/physics/player.qc +++ b/qcsrc/common/physics/player.qc @@ -7,10 +7,20 @@ #include #include "../triggers/trigger/viewloc.qh" +bool Physics_HasWord(string thelist, string theword) +{ + FOREACH_WORD(thelist, it == theword, + { + return true; + }); + + return false; +} + // client side physics bool Physics_Valid(string thecvar) { - return autocvar_g_physics_clientselect && thecvar != "" && thecvar && thecvar != "default" && strhasword(autocvar_g_physics_clientselect_options, thecvar); + return autocvar_g_physics_clientselect && thecvar != "" && thecvar && thecvar != "default" && Physics_HasWord(autocvar_g_physics_clientselect_options, thecvar); } float Physics_ClientOption(entity this, string option, float defaultval)