more knockback induced dismount

When looking at the previous commit, I realized that my comment about
radius 1 was wrong.  The original code prefers dismounting to spots
that are orthogonal to the steed's position over diagonal ones.  It
doesn't say why.
This commit is contained in:
PatR
2022-10-27 15:55:57 -07:00
parent da32b572a6
commit 9682f84aed

View File

@@ -512,11 +512,11 @@ landing_spot(
++viable;
distance = distu(x, y);
if (min_distance < 0 /* no viable candidate yet */
/* or better than pending candidate (note: distance
is never less than min_distance because we're
limiting search to radius 1; j==0 won't get here
because 'min_distance < 0' will always pass for it) */
|| (distance < min_distance || (best_j != -1 && j == 0))
/* or better than pending candidate (note: orthogonal
spots are distance 1 and diagonal ones distance 2;
treating one as better than the other is arbitary
and not wanted for DISMOUNT_KNOCKED) */
|| (best_j == -1) ? (distance < min_distance) : (j < 3)
/* or equally good, maybe substitute this one */
|| (distance == min_distance && !rn2(viable))) {
/* traps avoided on pass 0; boulders avoided on 0 and 1 */