summaryrefslogtreecommitdiff
path: root/players.c
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-11-11 23:08:07 +0000
committerDarkvater <darkvater@openttd.org>2006-11-11 23:08:07 +0000
commitd550c47c9a5ca714c3cdb5401a23dcb5ba453e08 (patch)
tree2b67a8f08678a27fa81db1cfdd29aa975c972097 /players.c
parent47e7ad7771fc361962fdc169caf7c1a3ed875a1d (diff)
downloadopenttd-d550c47c9a5ca714c3cdb5401a23dcb5ba453e08.tar.xz
(svn r7131) -Fix (r7126) which fixes (r2817) the activating of a function call that was
1. never executed before that and even if it would, it 2. could never be executed because if it did OpenTTD would crash
Diffstat (limited to 'players.c')
-rw-r--r--players.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/players.c b/players.c
index 3e4314568..abd188a0b 100644
--- a/players.c
+++ b/players.c
@@ -860,11 +860,18 @@ int32 CmdPlayerCtrl(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
if (_local_player != _network_playas) {
assert(_local_player == PLAYER_SPECTATOR && _network_playas == p->index);
_local_player = p->index;
- DoCommandP(0, (_patches.autorenew << 15 ) | (_patches.autorenew_months << 16) | 4, _patches.autorenew_money, NULL, CMD_SET_AUTOREPLACE);
-
MarkWholeScreenDirty();
}
+ /* Now that we have a new player, broadcast its autorenew settings to
+ * all clients so everything is in sync */
+ DoCommand(0,
+ (_patches.autorenew << 15 ) | (_patches.autorenew_months << 16) | 4,
+ _patches.autorenew_money,
+ DC_EXEC,
+ CMD_SET_AUTOREPLACE
+ );
+
#ifdef ENABLE_NETWORK
if (_network_server) {
/* XXX - UGLY! p2 (pid) is mis-used to fetch the client-id, done at