Author: cazfi
Date: Fri Nov 13 17:47:58 2015
New Revision: 30597

URL: http://svn.gna.org/viewcvs/freeciv?rev=30597&view=rev
Log:
Make sure that unit without UTYF_SETTLERS does not try to execute uninitialized 
work
tasks on autosettler code.

Reported by Louis Moureaux <louis94>

See bug #23998

Modified:
    branches/S2_5/server/advisors/autosettlers.c

Modified: branches/S2_5/server/advisors/autosettlers.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/server/advisors/autosettlers.c?rev=30597&r1=30596&r2=30597&view=diff
==============================================================================
--- branches/S2_5/server/advisors/autosettlers.c        (original)
+++ branches/S2_5/server/advisors/autosettlers.c        Fri Nov 13 17:47:58 2015
@@ -741,16 +741,16 @@
       completion_time = pf_path_last_position(path)->turn;
     }
     TIMING_LOG(AIT_WORKERS, TIMER_STOP);
-  }
-
-  adv_unit_new_task(punit, AUT_AUTO_SETTLER, best_tile);
-
-  auto_settler_setup_work(pplayer, punit, state, recursion, path,
-                          best_tile, best_act, &best_target,
-                          completion_time);
-
-  if (NULL != path) {
-    pf_path_destroy(path);
+
+    adv_unit_new_task(punit, AUT_AUTO_SETTLER, best_tile);
+
+    auto_settler_setup_work(pplayer, punit, state, recursion, path,
+                            best_tile, best_act, &best_target,
+                            completion_time);
+
+    if (NULL != path) {
+      pf_path_destroy(path);
+    }
   }
 }
 


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

Reply via email to