From aed78b9f57b0ed462b32d32c07e19454c647bb54 Mon Sep 17 00:00:00 2001 From: Louis Moureaux Date: Sat, 26 Aug 2023 03:52:22 +0200 Subject: [PATCH] Simplify tile_move_cost_ptrs It had two branches with identical code. --- common/map.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/common/map.cpp b/common/map.cpp index b4d847e86c..4b0d3a55de 100644 --- a/common/map.cpp +++ b/common/map.cpp @@ -759,19 +759,9 @@ int tile_move_cost_ptrs(const struct civ_map *nmap, const struct unit *punit, } else if (!is_native_tile_to_class(pclass, t2) || !is_native_tile_to_class(pclass, t1)) { - if (tile_city(t1) == nullptr) { - /* Loading to/disembarking from transport. */ - - // UTYF_IGTER units get move benefit. - return (utype_has_flag(punittype, UTYF_IGTER) ? MOVE_COST_IGTER - : SINGLE_MOVE); - } else { - /* Entering/leaving port. */ - - // UTYF_IGTER units get move benefit. - return (utype_has_flag(punittype, UTYF_IGTER) ? MOVE_COST_IGTER - : SINGLE_MOVE); - } + // UTYF_IGTER units get move benefit. + return (utype_has_flag(punittype, UTYF_IGTER) ? MOVE_COST_IGTER + : SINGLE_MOVE); } cost = tile_terrain(t2)->movement_cost * SINGLE_MOVE;