From: Mario Date: Thu, 24 Dec 2015 04:14:04 +0000 (+1000) Subject: Cleanse teamplay.qc of the looping horrors X-Git-Tag: xonotic-v0.8.2~1408 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7d4d4e54a5b0fdcce80d396fd9ab8b327ae1aa73;p=xonotic%2Fxonotic-data.pk3dir.git Cleanse teamplay.qc of the looping horrors --- diff --git a/qcsrc/server/teamplay.qc b/qcsrc/server/teamplay.qc index 1cd11b685..71f3bf48a 100644 --- a/qcsrc/server/teamplay.qc +++ b/qcsrc/server/teamplay.qc @@ -669,7 +669,7 @@ void ShufflePlayerOutOfTeam (float source_team) { float smallestteam, smallestteam_count, steam; float lowest_bot_score, lowest_player_score; - entity head, lowest_bot, lowest_player, selected; + entity lowest_bot, lowest_player, selected; smallestteam = 0; smallestteam_count = 999999999; @@ -716,28 +716,24 @@ void ShufflePlayerOutOfTeam (float source_team) lowest_player_score = 999999999; // find the lowest-scoring player & bot of that team - FOR_EACH_PLAYER(head) - { - if(head.team == steam) + FOREACH_CLIENT(IS_PLAYER(it) && it.team == steam, LAMBDA( + if(it.isbot) { - if(head.isbot) + if(it.totalfrags < lowest_bot_score) { - if(head.totalfrags < lowest_bot_score) - { - lowest_bot = head; - lowest_bot_score = head.totalfrags; - } + lowest_bot = it; + lowest_bot_score = it.totalfrags; } - else + } + else + { + if(it.totalfrags < lowest_player_score) { - if(head.totalfrags < lowest_player_score) - { - lowest_player = head; - lowest_player_score = head.totalfrags; - } + lowest_player = it; + lowest_player_score = it.totalfrags; } } - } + )); // prefers to move a bot... if(lowest_bot != world)