Skip to content

Commit

Permalink
Simplify tile_move_cost_ptrs
Browse files Browse the repository at this point in the history
It had two branches with identical code.
  • Loading branch information
lmoureaux committed Aug 30, 2023
1 parent 0cab365 commit aed78b9
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions common/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit aed78b9

Please sign in to comment.