Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2003:
[Freeciv-Dev] (PR#4447) traderoute info in popup
Home

[Freeciv-Dev] (PR#4447) traderoute info in popup

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: andrearo@xxxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#4447) traderoute info in popup
From: "Remi Bonnet" <remi.bonnet@xxxxxxxxxxx>
Date: Sat, 6 Sep 2003 02:08:05 -0700
Reply-to: rt@xxxxxxxxxxxxxx

I think the aim of this patch is great but there is errors in it:

gtk_widget_new(GTK_TYPE_LABEL, "GtkWidget::parent", b,
                       "GtkLabel::label",
_("with City Walls"), NULL);
        count++;
+      }
+
+      if ((punit =
get_unit_in_focus())) {
+        struct city *tcity = find_city_by_id(punit-
>homecity);
+
+        if (unit_flag(punit, F_TRADE_ROUTE) &&
+
can_establish_trade_route(pcity, tcity)) {

can_establish_trade_route() can be called only if can_cities_trade() has
returned true or it will trigger an assert. i don't think the current
behaviour is ok because can_establish_trade_route can return FALSE
instead of dying if can_cities_trade return FALSE but you still need to
correct this

+          my_snprintf(s, sizeof(s),
_("Trade with %s: %d"),
+                      tcity->name,
trade_between_cities(pcity,tcity));

What if the two cities already have a traderoute?

Remi


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