summaryrefslogtreecommitdiff
path: root/src/engine.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2008-02-15 21:05:46 +0000
committersmatz <smatz@openttd.org>2008-02-15 21:05:46 +0000
commit55b0146498ba3789406aa7bf08426a9b1e2eea2d (patch)
treeac22af8cf39dd1e9d1a6572689cde628017200e0 /src/engine.cpp
parenta13899ee8eba04189d4057f7ccf6a9deeba13dc3 (diff)
downloadopenttd-55b0146498ba3789406aa7bf08426a9b1e2eea2d.tar.xz
(svn r12150) -Fix (r12143): compiler warnings - possible use of uninitialised variable
Diffstat (limited to 'src/engine.cpp')
-rw-r--r--src/engine.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/engine.cpp b/src/engine.cpp
index 4005eac5e..bd50a9f61 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;
}