Author: sveinung
Date: Wed Aug  5 12:59:39 2015
New Revision: 29336

URL: http://svn.gna.org/viewcvs/freeciv?rev=29336&view=rev
Log:
Development version save game compatibility for action less unit orders

Load unit orders from 3.0 development version save games that were stored
before the action_list field was added.

See patch #6171

Modified:
    trunk/server/savegame3.c

Modified: trunk/server/savegame3.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/savegame3.c?rev=29336&r1=29335&r2=29336&view=diff
==============================================================================
--- trunk/server/savegame3.c    (original)
+++ trunk/server/savegame3.c    Wed Aug  5 12:59:39 2015
@@ -5098,7 +5098,10 @@
         struct unit_order *order = &punit->orders.list[j];
 
         if (orders_unitstr[j] == '\0' || dir_unitstr[j] == '\0'
-            || act_unitstr[j] == '\0' || action_unitstr[j] == '\0') {
+#ifndef FREECIV_DEV_SAVE_COMPAT
+            || action_unitstr[j] == '\0'
+#endif /* FREECIV_DEV_SAVE_COMPAT */
+            || act_unitstr[j] == '\0') {
           log_sg("Invalid unit orders.");
           free_unit_orders(punit);
           break;
@@ -5107,7 +5110,12 @@
         order->dir = char2dir(dir_unitstr[j]);
         order->activity = char2activity(act_unitstr[j]);
 
-        order->action = (action_unitstr[j] == '?'
+        order->action = (
+#ifdef FREECIV_DEV_SAVE_COMPAT
+                         action_unitstr[0] == '\0'
+                         ||
+#endif /* FREECIV_DEV_SAVE_COMPAT */
+                         action_unitstr[j] == '?'
                          ? ACTION_COUNT
                          : char2num(action_unitstr[j]));
 


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

Reply via email to