Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2005:
[Freeciv-Dev] Re: (PR#12100) AutoReply: show trade routes better
Home

[Freeciv-Dev] Re: (PR#12100) AutoReply: show trade routes better

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] Re: (PR#12100) AutoReply: show trade routes better
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 3 Feb 2005 16:16:01 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12100 >

Here's a version that actually works.

-jason


? mask-64x32.png
? newgrid.fig
? newgrid.png
Index: client/citydlg_common.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/citydlg_common.c,v
retrieving revision 1.58
diff -u -r1.58 citydlg_common.c
--- client/citydlg_common.c     2 Feb 2005 02:44:31 -0000       1.58
+++ client/citydlg_common.c     4 Feb 2005 00:11:27 -0000
@@ -419,14 +419,16 @@
   /* Special cases for "bonus" production.  See set_city_production in
    * city.c. */
   if (otype == O_TRADE) {
-    int routes = 0, i;
+    int i;
 
     for (i = 0; i < NUM_TRADEROUTES; i++) {
-      routes += pcity->trade_value[i];
-    }
-    if (routes != 0) {
-      cat_snprintf(buf, bufsz, _("%+4d : Trade routes\n"), routes);
-      total += routes;
+      if (pcity->trade[i] != 0 && pcity->trade_value[i] != 0) {
+       struct city *trade_city = find_city_by_id(pcity->trade[i]);
+
+       cat_snprintf(buf, bufsz, _("%+4d : Trade route with %s\n"),
+                    pcity->trade_value[i], trade_city->name);
+       total += pcity->trade_value[i];
+      }
     }
   } else if (otype == O_GOLD) {
     int tithes = get_city_tithes_bonus(pcity);

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Re: (PR#12100) AutoReply: show trade routes better, Jason Short <=