1
0
Fork 0

(svn r20560) -Fix: AIs (still/again?) crashing for certain commands

release/1.1
rubidium 2010-08-19 14:25:07 +00:00
parent 85740a0283
commit 55c1af9fb1
1 changed files with 5 additions and 0 deletions

View File

@ -209,6 +209,11 @@ bool AIObject::DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint cmd, const c
/* Are we only interested in the estimate costs? */ /* Are we only interested in the estimate costs? */
bool estimate_only = GetDoCommandMode() != NULL && !GetDoCommandMode()(); bool estimate_only = GetDoCommandMode() != NULL && !GetDoCommandMode()();
#ifdef ENABLE_NETWORK
/* Only set p2 when the command does not come from the network. */
if (GetCommandFlags(cmd) & CMD_CLIENT_ID && p2 == 0) p2 = UINT32_MAX;
#endif
/* Try to perform the command. */ /* Try to perform the command. */
CommandCost res = ::DoCommandPInternal(tile, p1, p2, cmd, _networking ? CcAI : NULL, text, false, estimate_only); CommandCost res = ::DoCommandPInternal(tile, p1, p2, cmd, _networking ? CcAI : NULL, text, false, estimate_only);