]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Attempt to optimise physics valid checking by using a custom word checker
authorMario <mario@smbclan.net>
Thu, 18 Jan 2018 12:50:10 +0000 (22:50 +1000)
committerMario <mario@smbclan.net>
Thu, 18 Jan 2018 12:50:10 +0000 (22:50 +1000)
qcsrc/common/physics/player.qc

index 20c580a8591b0e371981d671ba208a459229e2b2..ae8ffa3fe67a0b50f89c71237f57a6fe656fed7b 100644 (file)
@@ -7,10 +7,20 @@
 #include <server/miscfunctions.qh>
 #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)