changeset 8572:8a95003be848 draft

(svn r12150) -Fix (r12143): compiler warnings - possible use of uninitialised variable
author smatz <smatz@openttd.org>
date Fri, 15 Feb 2008 21:05:46 +0000
parents b611278e4fed
children ed1fec953237
files src/engine.cpp
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/engine.cpp
+++ b/src/engine.cpp
@@ -204,7 +204,7 @@
 	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 @@
 		if (best_player == PLAYER_SPECTATOR) return PLAYER_SPECTATOR;
 
 		SetBit(mask, best_player);
-	}
+	} while (--p != 0);
 
 	return best_player;
 }