Author: sveinung
Date: Sun Aug  9 15:12:48 2015
New Revision: 29422

URL: http://svn.gna.org/viewcvs/freeciv?rev=29422&view=rev
Log:
Development version save game compatibility order upgrade

Upgrade orders that have been replaced by the perform action order when
loading old 3.0 development version save games if development save game
compatibility is enabled.

See patch #6196

Modified:
    trunk/server/savegame3.c

Modified: trunk/server/savegame3.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/savegame3.c?rev=29422&r1=29421&r2=29422&view=diff
==============================================================================
--- trunk/server/savegame3.c    (original)
+++ trunk/server/savegame3.c    Sun Aug  9 15:12:48 2015
@@ -5119,6 +5119,23 @@
                          ? ACTION_COUNT
                          : char2num(action_unitstr[j]));
 
+#ifdef FREECIV_DEV_SAVE_COMPAT
+        if (order->order != ORDER_PERFORM_ACTION
+            && order->action == ACTION_COUNT) {
+          /* This order may have been replaced by the perform action
+           * order */
+
+          /* See if a corresponding action exists. */
+          order->action = sg_order_to_action(order->order, punit,
+                                             punit->goto_tile);
+
+          if (order->action != ACTION_COUNT) {
+            /* The order should be upgraded. */
+            order->order = ORDER_PERFORM_ACTION;
+          }
+        }
+#endif /* FREECIV_DEV_SAVE_COMPAT */
+
         if (order->order == ORDER_LAST
             || (order->order == ORDER_MOVE && !direction8_is_valid(order->dir))
             || (order->order == ORDER_ACTIVITY


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

Reply via email to