From: terencehill Date: Fri, 22 Jun 2018 16:11:36 +0000 (+0200) Subject: Bot AI: Freezetag: fix wrong count of unfrozen players causing bots to choose the... X-Git-Tag: xonotic-v0.8.5~1923^2~23 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a43511f5a75f3ece05afd13811f8e32c60e8d98c;p=xonotic%2Fxonotic-data.pk3dir.git Bot AI: Freezetag: fix wrong count of unfrozen players causing bots to choose the role havocbot_role_ft_freeing when no teammate is frozen --- diff --git a/qcsrc/common/gamemodes/gamemode/freezetag/freezetag.qc b/qcsrc/common/gamemodes/gamemode/freezetag/freezetag.qc index 9205e8975..efa06461d 100644 --- a/qcsrc/common/gamemodes/gamemode/freezetag/freezetag.qc +++ b/qcsrc/common/gamemodes/gamemode/freezetag/freezetag.qc @@ -250,10 +250,10 @@ void havocbot_role_ft_offense(entity this) // Count how many players on team are unfrozen. int unfrozen = 0; - FOREACH_CLIENT(IS_PLAYER(it) && SAME_TEAM(it, this) && !(STAT(FROZEN, it) != 1), { unfrozen++; }); + FOREACH_CLIENT(IS_PLAYER(it) && SAME_TEAM(it, this) && !STAT(FROZEN, it), { unfrozen++; }); // If only one left on team or if role has timed out then start trying to free players. - if (((unfrozen == 0) && (!STAT(FROZEN, this))) || (time > this.havocbot_role_timeout)) + if ((unfrozen == 0 && !STAT(FROZEN, this)) || time > this.havocbot_role_timeout) { LOG_TRACE("changing role to freeing"); this.havocbot_role = havocbot_role_ft_freeing;