Skip to content

Commit

Permalink
Switch to the Euclidian distance for trademindist
Browse files Browse the repository at this point in the history
See #882.
  • Loading branch information
lmoureaux committed Dec 27, 2023
1 parent 9892203 commit cdf3ea3
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions common/traderoutes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

/**
Expand Down Expand Up @@ -463,7 +463,6 @@ int get_caravan_enter_city_trade_bonus(const struct city *pc1,
}

if (game.info.caravan_bonus_style == CBS_CLASSIC) {
// Should this be real_map_distance (rmd)?
tb = rmd + 10;
tb = (tb * (pc1->surplus[O_TRADE] + trade2)) / 24;
} else if (game.info.caravan_bonus_style == CBS_LOGARITHMIC) {
Expand Down

0 comments on commit cdf3ea3

Please sign in to comment.