Author: sveinung Date: Tue Sep 9 15:26:33 2014 New Revision: 26312 URL: http://svn.gna.org/viewcvs/freeciv?rev=26312&view=rev Log: Gtk clients: Only offer to establish a trade route if the unit can do it.
A unit can have the HelpWonder unit type flag but not the TradeRoute unit type flag. It is therefore possible that a unit can help a wonder without being able to establishing a trade route or to entering the market place. See bug #22592 Modified: branches/S2_4/client/gui-gtk-2.0/caravan_dialog.c branches/S2_4/client/gui-gtk-3.0/caravan_dialog.c Modified: branches/S2_4/client/gui-gtk-2.0/caravan_dialog.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_4/client/gui-gtk-2.0/caravan_dialog.c?rev=26312&r1=26311&r2=26312&view=diff ============================================================================== --- branches/S2_4/client/gui-gtk-2.0/caravan_dialog.c (original) +++ branches/S2_4/client/gui-gtk-2.0/caravan_dialog.c Tue Sep 9 15:26:33 2014 @@ -111,7 +111,8 @@ get_help_build_wonder_button_label(wonder, sizeof(wonder), &can_wonder); - can_trade = can_cities_trade(phomecity, pdestcity); + can_trade = (unit_has_type_flag(punit, F_TRADE_ROUTE) + && can_cities_trade(phomecity, pdestcity)); can_establish = can_trade && can_establish_trade_route(phomecity, pdestcity); Modified: branches/S2_4/client/gui-gtk-3.0/caravan_dialog.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_4/client/gui-gtk-3.0/caravan_dialog.c?rev=26312&r1=26311&r2=26312&view=diff ============================================================================== --- branches/S2_4/client/gui-gtk-3.0/caravan_dialog.c (original) +++ branches/S2_4/client/gui-gtk-3.0/caravan_dialog.c Tue Sep 9 15:26:33 2014 @@ -111,7 +111,8 @@ get_help_build_wonder_button_label(wonder, sizeof(wonder), &can_wonder); - can_trade = can_cities_trade(phomecity, pdestcity); + can_trade = (unit_has_type_flag(punit, F_TRADE_ROUTE) + && can_cities_trade(phomecity, pdestcity)); can_establish = can_trade && can_establish_trade_route(phomecity, pdestcity); _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits