Author: cazfi Date: Mon Apr 27 19:21:09 2015 New Revision: 28923 URL: http://svn.gna.org/viewcvs/freeciv?rev=28923&view=rev Log: Fixed the way AI calculates how much trade would be lost when trade routes get cancelled.
See bug #23532 Modified: trunk/common/aicore/caravan.c Modified: trunk/common/aicore/caravan.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/common/aicore/caravan.c?rev=28923&r1=28922&r2=28923&view=diff ============================================================================== --- trunk/common/aicore/caravan.c (original) +++ trunk/common/aicore/caravan.c Mon Apr 27 19:21:09 2015 @@ -289,7 +289,13 @@ if (countloser) { city_list_iterate(would_remove, losercity) { if (city_owner(losercity) == pplayer) { - losttrade += oldtrade; + int i; + + for (i = 0; i < MAX_TRADE_ROUTES; i++) { + if (losercity->trade[i] == pcity->id) { + losttrade += losercity->trade_value[i]; + } + } } } city_list_iterate_end; city_list_destroy(would_remove); _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits