From a27a9c99e2eda6d8cb7710a3d276418c87821fde Mon Sep 17 00:00:00 2001 From: Louis Moureaux Date: Wed, 27 Dec 2023 05:34:28 +0100 Subject: [PATCH] Use the Euclidian distance for CLASSIC trade route revenue The CLASSIC trade route revenue style was using map_distance() which is the Manhattan distance. Using Euclidian makes much more sense since this is how units move. Closes #882. --- common/traderoutes.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/common/traderoutes.cpp b/common/traderoutes.cpp index 013b98f851..23b97811a5 100644 --- a/common/traderoutes.cpp +++ b/common/traderoutes.cpp @@ -449,23 +449,22 @@ 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