From 982c9de4043d84a15eeb0f78bed781a37c1af940 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 18 Jan 2018 22:50:10 +1000 Subject: [PATCH] Attempt to optimise physics valid checking by using a custom word checker --- qcsrc/common/physics/player.qc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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) -- 2.39.2