Author: cazfi
Date: Sat Apr 25 19:25:30 2015
New Revision: 28871

URL: http://svn.gna.org/viewcvs/freeciv?rev=28871&view=rev
Log:
Save dummy direction and goods information about empty trade route slots.

See bug #23535

Modified:
    trunk/server/savegame3.c

Modified: trunk/server/savegame3.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/savegame3.c?rev=28871&r1=28870&r2=28871&view=diff
==============================================================================
--- trunk/server/savegame3.c    (original)
+++ trunk/server/savegame3.c    Sat Apr 25 19:25:30 2015
@@ -4523,10 +4523,17 @@
     for (j = 0; j < MAX_TRADE_ROUTES; j++) {
       secfile_insert_int(saving->file, pcity->trade[j], "%s.traderoute%d",
                          buf, j);
-      secfile_insert_str(saving->file, 
route_direction_name(pcity->trade_direction[i]),
-                         "%s.route_direction%d", buf, j);
-      secfile_insert_str(saving->file, goods_rule_name(pcity->trade_goods[i]),
-                         "%s.route_good%d", buf, j);
+      if (pcity->trade[j] != 0) {
+        secfile_insert_str(saving->file, 
route_direction_name(pcity->trade_direction[i]),
+                           "%s.route_direction%d", buf, j);
+        secfile_insert_str(saving->file, 
goods_rule_name(pcity->trade_goods[i]),
+                           "%s.route_good%d", buf, j);
+      } else {
+        secfile_insert_str(saving->file, 
route_direction_name(RDIR_BIDIRECTIONAL),
+                           "%s.route_direction%d", buf, j);
+        secfile_insert_str(saving->file, goods_rule_name(goods_by_number(0)),
+                           "%s.route_good%d", buf, j);
+      }
     }
 
     secfile_insert_int(saving->file, pcity->food_stock, "%s.food_stock",


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

Reply via email to