Author: sveinung
Date: Tue Mar  3 13:02:26 2015
New Revision: 28376

URL: http://svn.gna.org/viewcvs/freeciv?rev=28376&view=rev
Log:
Allow the orders system to tell a unit to go to and fortify.

See patch #5881

Modified:
    trunk/server/unithand.c
    trunk/server/unittools.c

Modified: trunk/server/unithand.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/unithand.c?rev=28376&r1=28375&r2=28376&view=diff
==============================================================================
--- trunk/server/unithand.c     (original)
+++ trunk/server/unithand.c     Tue Mar  3 13:02:26 2015
@@ -2937,6 +2937,7 @@
       case ACTIVITY_TRANSFORM:
        /* Simple activities. */
        break;
+      case ACTIVITY_FORTIFYING:
       case ACTIVITY_SENTRY:
         if (i != length - 1) {
           /* Only allowed as the last order. */
@@ -2954,7 +2955,6 @@
         }
         break;
       /* Not supported yet. */
-      case ACTIVITY_FORTIFYING:
       case ACTIVITY_CONVERT:
       case ACTIVITY_EXPLORE:
       case ACTIVITY_IDLE:

Modified: trunk/server/unittools.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/unittools.c?rev=28376&r1=28375&r2=28376&view=diff
==============================================================================
--- trunk/server/unittools.c    (original)
+++ trunk/server/unittools.c    Tue Mar  3 13:02:26 2015
@@ -3824,7 +3824,9 @@
     case ORDER_ACTIVITY:
       activity = order.activity;
       {
-        struct extra_type *pextra = extra_by_number(order.target);
+        struct extra_type *pextra = (order.target == EXTRA_NONE ?
+                                       NULL :
+                                       extra_by_number(order.target));
 
         if (can_unit_do_activity_targeted(punit, activity, pextra)) {
           punit->done_moving = TRUE;


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

Reply via email to