Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2004:
[Freeciv-Dev] (PR#10504) F_TRADE_ROUTE doesn't have route distance info.
Home

[Freeciv-Dev] (PR#10504) F_TRADE_ROUTE doesn't have route distance info.

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: kaufman@xxxxxxxxxxxxxxxxxxxxxx
Cc: Rik van Riel <riel@xxxxxxxxxxx>
Subject: [Freeciv-Dev] (PR#10504) F_TRADE_ROUTE doesn't have route distance info.
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 12 Oct 2004 20:08:50 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=10504 >

How about this?  It clarifies that it is Manhattan distance being used
(without explaining what Manhattan distance means, but that's okay since
once someone figures it out it will all make sense).

It also adds a comment to city.c linking it with the documentation.

It should be applied to development and stable branches.  But I still
want to get rid of map_distance in the development branch.  IMO
sq_map_distance should be used here.

jason

? fctest
? freeciv-2.0.0-beta1.tar.gz
Index: client/helpdata.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/helpdata.c,v
retrieving revision 1.81
diff -u -r1.81 helpdata.c
--- client/helpdata.c   27 Sep 2004 21:58:51 -0000      1.81
+++ client/helpdata.c   13 Oct 2004 03:06:02 -0000
@@ -687,7 +687,12 @@
     }
   }
   if (unit_type_flag(i, F_TRADE_ROUTE)) {
-    sprintf(buf + strlen(buf), _("* Can establish trade routes.\n"));
+    /* TRANS: "Manhattan" distance is the distance along gridlines, with
+     * no diagonals allowed. */
+    sprintf(buf + strlen(buf), _("* Can establish trade routes (must travel "
+                                 "to target city and must be at least 9 "
+                                 "tiles [in Manhattan distance] from this "
+                                "unit's home city).\n"));
   }
   if (unit_type_flag(i, F_HELP_WONDER)) {
     sprintf(buf + strlen(buf),
Index: common/city.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/city.c,v
retrieving revision 1.249.2.1
diff -u -r1.249.2.1 city.c
--- common/city.c       8 Oct 2004 05:11:53 -0000       1.249.2.1
+++ common/city.c       13 Oct 2004 03:06:07 -0000
@@ -891,6 +891,8 @@
 **************************************************************************/
 bool can_cities_trade(const struct city *pc1, const struct city *pc2)
 {
+  /* If you change the logic here, make sure to update the help in
+   * helptext_unit(). */
   return (pc1 && pc2 && pc1 != pc2
           && (pc1->owner != pc2->owner
              || map_distance(pc1->tile, pc2->tile) > 8));

[Prev in Thread] Current Thread [Next in Thread]