diff --git a/common/traderoutes.cpp b/common/traderoutes.cpp index 013b98f851..4e26a1b73a 100644 --- a/common/traderoutes.cpp +++ b/common/traderoutes.cpp @@ -205,12 +205,12 @@ 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 - && (city_owner(pc1) != city_owner(pc2) - || map_distance(pc1->tile, pc2->tile) >= game.info.trademindist) - && (trade_route_type_trade_pct(cities_trade_route_type(pc1, pc2)) - > 0)); + return (pc1 && pc2 && pc1 != pc2 + && (city_owner(pc1) != city_owner(pc2) + || real_map_distance(pc1->tile, pc2->tile) + >= game.info.trademindist) + && (trade_route_type_trade_pct(cities_trade_route_type(pc1, pc2)) + > 0)); } /** @@ -449,23 +449,21 @@ int get_caravan_enter_city_trade_bonus(const struct city *pc1, struct goods_type *pgood, const bool establish_trade) { - int md, rmd, trade2, max_trade_2; + int rmd, trade2, max_trade_2; int tb = 0, bonus = 0; if (pc2) { - md = map_distance(pc1->tile, pc2->tile); rmd = real_map_distance(pc1->tile, pc2->tile); trade2 = pc2->surplus[O_TRADE]; max_trade_2 = max_trade_prod(pc2, seen_as); } else { - md = rmd = 10; + rmd = 10; trade2 = pc1->surplus[O_TRADE] * 0.75; max_trade_2 = max_trade_prod(pc1, seen_as) * 0.75; } if (game.info.caravan_bonus_style == CBS_CLASSIC) { - // Should this be real_map_distance (rmd)? - tb = md + 10; + tb = rmd + 10; tb = (tb * (pc1->surplus[O_TRADE] + trade2)) / 24; } else if (game.info.caravan_bonus_style == CBS_LOGARITHMIC) { // Logarithmic bonus