Author: cazfi
Date: Sat May  9 13:56:34 2015
New Revision: 29024

URL: http://svn.gna.org/viewcvs/freeciv?rev=29024&view=rev
Log:
Moved code to clear worker tasks upon player control gaining from classic AI to 
default AI.

See patch #6049

Modified:
    trunk/ai/classic/classicai.c
    trunk/ai/default/aiplayer.c

Modified: trunk/ai/classic/classicai.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/ai/classic/classicai.c?rev=29024&r1=29023&r2=29024&view=diff
==============================================================================
--- trunk/ai/classic/classicai.c        (original)
+++ trunk/ai/classic/classicai.c        Sat May  9 13:56:34 2015
@@ -18,9 +18,6 @@
 /* common */
 #include "ai.h"
 #include "player.h"
-
-/* server */
-#include "citytools.h"
 
 /* server/advisors */
 #include "advdata.h"
@@ -120,11 +117,6 @@
 static void cai_gained_control(struct player *pplayer)
 {
   struct ai_type *deftype = classic_ai_get_self();
-
-  /* Clear worker tasks, classic AI does not use those */
-  city_list_iterate(pplayer->cities, pcity) {
-    clear_worker_tasks(pcity);
-  } city_list_iterate_end;
 
   dai_gained_control(deftype, pplayer);
 }

Modified: trunk/ai/default/aiplayer.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/ai/default/aiplayer.c?rev=29024&r1=29023&r2=29024&view=diff
==============================================================================
--- trunk/ai/default/aiplayer.c (original)
+++ trunk/ai/default/aiplayer.c Sat May  9 13:56:34 2015
@@ -19,6 +19,9 @@
 #include "ai.h"
 #include "city.h"
 #include "unit.h"
+
+/* server */
+#include "citytools.h"
 
 /* ai/default */
 #include "aidata.h"
@@ -144,5 +147,10 @@
     } multipliers_iterate_end;
   }
 
+  /* Clear worker tasks, classic AI does not use those */
+  city_list_iterate(pplayer->cities, pcity) {
+    clear_worker_tasks(pcity);
+  } city_list_iterate_end;
+
   dai_assess_danger_player(ait, pplayer);
 }


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to