Summary: Check goto sanity with pathfinding
Submitted by: persia
Submitted on: Fri 04 Apr 2014 10:08:44 PM JST
Priority: 5 - Normal
Assigned to: None
Discussion Lock: Any
The current goto sanity check uses move_type as part of the determination of
whether a unit can get from somewhere to somewhere else, along with some
internal information (e.g. continent identifiers). This fares poorly with
unit classes that have complex nativity (may be UMT_BOTH, but may not be able
to cross deep oceans, or may be UMT_LAND, but unable to traverse mountain
The attached patch replaces the heuristic sanity check with a test of whether
there is a valid path according to the pathfinding algorithms. Attack moves
are selected because goto_is_sane() is sometimes used in situations where the
unit will want to attack at the destination.
Note that although this reduces the number of uses of UMT_LAND, UMT_SEA, and
UMT_BOTH in the code, it won't actually correctly test goto sanity for units
with complex nativity until patch #3901 lands, although this may be applied
independently, and the ordering of the patches is not important.
Date: Fri 04 Apr 2014 10:08:44 PM JST Name:
check-goto-sanity-with-pathfinding.patch Size: 9kB By: persia
Reply to this item at:
Message sent via/by Gna!
Freeciv-dev mailing list