mirror of https://github.com/OpenTTD/OpenTTD
(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 returnedrelease/0.4.5
parent
c872ac4eb4
commit
b6ca90e021
6
ai/ai.c
6
ai/ai.c
|
@ -134,12 +134,16 @@ int32 AI_DoCommand(uint tile, uint32 p1, uint32 p2, uint32 flags, uint procc)
|
||||||
int32 AI_DoCommandChecked(uint tile, uint32 p1, uint32 p2, uint32 flags, uint procc)
|
int32 AI_DoCommandChecked(uint tile, uint32 p1, uint32 p2, uint32 flags, uint procc)
|
||||||
{
|
{
|
||||||
AICommand *new;
|
AICommand *new;
|
||||||
uint unique_id = uids[_current_player]++;
|
uint unique_id = uids[_current_player];
|
||||||
int32 res;
|
int32 res;
|
||||||
|
|
||||||
res = DoCommandByTile(tile, p1, p2, flags & ~DC_EXEC, procc);
|
res = DoCommandByTile(tile, p1, p2, flags & ~DC_EXEC, procc);
|
||||||
if (CmdFailed(res))
|
if (CmdFailed(res))
|
||||||
return CMD_ERROR;
|
return CMD_ERROR;
|
||||||
|
if (!(flags & DC_EXEC))
|
||||||
|
return res;
|
||||||
|
|
||||||
|
uids[_current_player]++;
|
||||||
|
|
||||||
/* Save the command and his things, together with the unique_id */
|
/* Save the command and his things, together with the unique_id */
|
||||||
new = malloc(sizeof(AICommand));
|
new = malloc(sizeof(AICommand));
|
||||||
|
|
Loading…
Reference in New Issue