summaryrefslogtreecommitdiff
path: root/src/players.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2007-12-28 18:25:30 +0000
committersmatz <smatz@openttd.org>2007-12-28 18:25:30 +0000
commit108ab3b91066ec1f97770401ba31f0afb681e794 (patch)
treeca35c0f55d6809f32b3fbf9c31c826a29d785ac7 /src/players.cpp
parentc87f20ff37e710575246ee31902c9a7b2235e111 (diff)
downloadopenttd-108ab3b91066ec1f97770401ba31f0afb681e794.tar.xz
(svn r11717) -Fix [FS#1590]: make sure invalid players have all shares owned by PLAYER_SPECTATOR
Diffstat (limited to 'src/players.cpp')
-rw-r--r--src/players.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/players.cpp b/src/players.cpp
index 2443966e7..430a7811e 100644
--- a/src/players.cpp
+++ b/src/players.cpp
@@ -544,7 +544,10 @@ static void MaybeStartNewPlayer()
void InitializePlayers()
{
memset(_players, 0, sizeof(_players));
- for (PlayerID i = PLAYER_FIRST; i != MAX_PLAYERS; i++) _players[i].index = i;
+ for (PlayerID i = PLAYER_FIRST; i != MAX_PLAYERS; i++) {
+ _players[i].index = i;
+ for (uint j = 0; j < 4; j++) _players[i].share_owners[j] = PLAYER_SPECTATOR;
+ }
_cur_player_tick_index = 0;
}