]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Make sure forced team ID list checker doesn't try with an empty list or search pattern
authorMario <mario@smbclan.net>
Sat, 15 Jul 2017 22:33:55 +0000 (08:33 +1000)
committerMario <mario@smbclan.net>
Sat, 15 Jul 2017 22:33:55 +0000 (08:33 +1000)
qcsrc/server/client.qc

index 58d15b31cb234bd08f5a537850b4098a7cc19301..4a1961df899a2eeb9475af1b69b9f01bb70e1172 100644 (file)
@@ -1053,6 +1053,9 @@ void FixClientCvars(entity e)
 
 bool findinlist_abbrev(string tofind, string list)
 {
+       if(list == "" || tofind == "")
+               return false; // empty list or search, just return
+
        // this function allows abbreviated strings!
        FOREACH_WORD(list, it == substring(tofind, 0, strlen(it)),
        {
@@ -1082,7 +1085,7 @@ bool PlayerInIDList(entity p, string idlist)
 
 bool PlayerInList(entity player, string list)
 {
-       return PlayerInIDList(player, list) || PlayerInIPList(player, list);
+       return boolean(PlayerInIDList(player, list) || PlayerInIPList(player, list));
 }
 
 #ifdef DP_EXT_PRECONNECT