summaryrefslogtreecommitdiff
path: root/ai
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2005-12-09 19:12:11 +0000
committertruelight <truelight@openttd.org>2005-12-09 19:12:11 +0000
commit0941c039ab80dad8ade1be0a69a6247e27292378 (patch)
tree680f3ac5bf4927c4c89f06e79ff6975df065a60f /ai
parente9e5f2a2357e76bb14a87f11a40823ea0e26d7a3 (diff)
downloadopenttd-0941c039ab80dad8ade1be0a69a6247e27292378.tar.xz
(svn r3278) -Fix: lets update the tail-pointer if we add a new item, else the linkedlist never grows ;)
Diffstat (limited to 'ai')
-rw-r--r--ai/ai.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ai/ai.c b/ai/ai.c
index 4e1545e77..27da82337 100644
--- a/ai/ai.c
+++ b/ai/ai.c
@@ -153,8 +153,10 @@ int32 AI_DoCommandChecked(uint tile, uint32 p1, uint32 p2, uint32 flags, uint pr
/* Add it to the back of the list */
if (command_uid_tail[_current_player] == NULL)
command_uid_tail[_current_player] = new;
- else
+ else {
command_uid_tail[_current_player]->next = new;
+ command_uid_tail[_current_player] = new;
+ }
if (command_uid[_current_player] == NULL)
command_uid[_current_player] = new;