(svn r3278) -Fix: lets update the tail-pointer if we add a new item, else the linkedlist never grows ;)
authortruelight
Fri, 09 Dec 2005 19:12:11 +0000
changeset 2733 3511745428a8
parent 2732 55b5faab1a47
child 2734 3fd8a3519be0
(svn r3278) -Fix: lets update the tail-pointer if we add a new item, else the linkedlist never grows ;)
ai/ai.c
--- a/ai/ai.c	Fri Dec 09 17:42:56 2005 +0000
+++ b/ai/ai.c	Fri Dec 09 19:12:11 2005 +0000
@@ -153,8 +153,10 @@
 	/* 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;