# HG changeset patch # User truelight # Date 1134156551 0 # Node ID a2b52101be1cb2c086cf11098086b4bbc4fcf59b # Parent d8f39e8819a38bf1dd7ca570be1c96e58888fe2c (svn r3279) -Fix: do not try to execute something that is not set to execute -Fix: do not increase an uid number if it isn't returned diff -r d8f39e8819a3 -r a2b52101be1c ai/ai.c --- a/ai/ai.c Fri Dec 09 19:12:11 2005 +0000 +++ b/ai/ai.c Fri Dec 09 19:29:11 2005 +0000 @@ -134,12 +134,16 @@ int32 AI_DoCommandChecked(uint tile, uint32 p1, uint32 p2, uint32 flags, uint procc) { AICommand *new; - uint unique_id = uids[_current_player]++; + uint unique_id = uids[_current_player]; int32 res; res = DoCommandByTile(tile, p1, p2, flags & ~DC_EXEC, procc); if (CmdFailed(res)) return CMD_ERROR; + if (!(flags & DC_EXEC)) + return res; + + uids[_current_player]++; /* Save the command and his things, together with the unique_id */ new = malloc(sizeof(AICommand));