From 3c9341dcede7489cc4ac313d92b1f5e987e25eaf Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 7 Jan 2022 16:36:58 +0200 Subject: [PATCH 45/45] Make Good requirement to be false when traderoute is inactive Reported by ddeanbrown See osdn #43542 Signed-off-by: Marko Lindqvist --- common/traderoutes.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/common/traderoutes.c b/common/traderoutes.c index 8afe3c2872..bc6112b8fb 100644 --- a/common/traderoutes.c +++ b/common/traderoutes.c @@ -681,7 +681,20 @@ bool city_receives_goods(const struct city *pcity, trade_routes_iterate(pcity, proute) { if (proute->goods == pgood && (proute->dir == RDIR_TO || proute->dir == RDIR_BIDIRECTIONAL)) { - return TRUE; + struct city *tcity = game_city_by_number(proute->partner); + enum trade_route_type type; + struct trade_route_settings *settings; + + if (can_cities_trade(pcity, tcity)) { + return TRUE; + } + + type = cities_trade_route_type(pcity, tcity); + settings = trade_route_settings_by_type(type); + + if (settings->cancelling == TRI_ACTIVE) { + return TRUE; + } } } trade_routes_iterate_end; -- 2.34.1