From: Mario Date: Sat, 15 Jul 2017 22:33:55 +0000 (+1000) Subject: Make sure forced team ID list checker doesn't try with an empty list or search pattern X-Git-Tag: xonotic-v0.8.5~2608 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=98c503e4981ebcc2bec3ced7f700fb2b319f3274;p=xonotic%2Fxonotic-data.pk3dir.git Make sure forced team ID list checker doesn't try with an empty list or search pattern --- diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 58d15b31c..4a1961df8 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -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