<URL: http://bugs.freeciv.org/Ticket/Display.html?id=39563 >

 Fix to actual bug. Needs some more testing to check if this is the
only problem.


 - ML

diff -Nurd -X.diff_ignore freeciv/ai/aitools.c freeciv/ai/aitools.c
--- freeciv/ai/aitools.c	2008-01-20 04:02:14.000000000 +0200
+++ freeciv/ai/aitools.c	2008-02-10 11:28:34.000000000 +0200
@@ -1168,7 +1168,13 @@
 void copy_if_better_choice(struct ai_choice *cur, struct ai_choice *best)
 {
   if (best->want < cur->want) {
-    best = cur;
+    /* This simple minded copy works for now.
+     *
+     * TODO: We should get rid of this function. Choice structures should
+     *       be accessed via pointers, and those pointers should be updated
+     *       instead of copying whole structures.
+     */
+    *best = *cur;
   }
 }
 
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to