diff --git a/src/engine.cpp b/src/engine.cpp index 4005eac5e2..bd50a9f61a 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -204,7 +204,7 @@ static PlayerID GetBestPlayer(uint8 pp) PlayerID best_player; uint mask = 0; - for (; pp != 0; pp--) { + do { best_hist = -1; best_player = PLAYER_SPECTATOR; FOR_ALL_PLAYERS(p) { @@ -218,7 +218,7 @@ static PlayerID GetBestPlayer(uint8 pp) if (best_player == PLAYER_SPECTATOR) return PLAYER_SPECTATOR; SetBit(mask, best_player); - } + } while (--p != 0); return best_player; }