Author: sveinung
Date: Tue Feb 24 10:00:27 2015
New Revision: 28305

URL: http://svn.gna.org/viewcvs/freeciv?rev=28305&view=rev
Log:
Always clear a unit's ai_controlled state when receiving new orders for it.

Before this patch a unit would lose its auto settler state when asked to
build a single road (via unit_change_activity) but keep it when asked to
build many roads (via unit_orders). This patch makes the behavior
consistent.

A player that wish a unit to be auto settler controlled after its orders are
executed can still set the unit's auto setter state immediately after giving
it the new orders.

See bug #23307

Modified:
    trunk/server/unithand.c

Modified: trunk/server/unithand.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/unithand.c?rev=28305&r1=28304&r2=28305&view=diff
==============================================================================
--- trunk/server/unithand.c     (original)
+++ trunk/server/unithand.c     Tue Feb 24 10:00:27 2015
@@ -2984,6 +2984,10 @@
   /* If we waited on a tile, reset punit->done_moving */
   punit->done_moving = (punit->moves_left <= 0);
 
+  /* Make sure that the unit won't keep its old ai_controlled state after
+   * it has recieved new orders from the client. */
+  punit->ai_controlled = FALSE;
+
   if (length == 0) {
     fc_assert(!unit_has_orders(punit));
     send_unit_info(NULL, punit);


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

Reply via email to