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