changeset 15864:1ce9c097ee89 draft

(svn r20546) -Fix (r20542): starting AIs shouldn't cause an assertion to trigger
author rubidium <rubidium@openttd.org>
date Wed, 18 Aug 2010 18:57:58 +0000
parents 4e8143e1afeb
children 270f9b0689cc
files src/command.cpp
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/command.cpp
+++ b/src/command.cpp
@@ -501,7 +501,8 @@
 	int y = TileY(tile) * TILE_SIZE;
 
 #ifdef ENABLE_NETWORK
-	if (only_sending && GetCommandFlags(cmd) & CMD_CLIENT_ID) p2 = CLIENT_ID_SERVER;
+	/* Only set p2 when the command does not come from the network. */
+	if (!(cmd & CMD_NETWORK_COMMAND) && GetCommandFlags(cmd) & CMD_CLIENT_ID) p2 = CLIENT_ID_SERVER;
 #endif
 
 	CommandCost res = DoCommandPInternal(tile, p1, p2, cmd, callback, text, my_cmd, estimate_only);