fix(rules): stop auto-directed movement cutting corners

PF1e (CRB, Measuring Distance): "You can't move diagonally past a corner
(even by taking a 5-foot step)". _best_move_step (the greedy descent behind
the auto-directed move/run/5-foot-step) now enforces the same
diagonal_allowed corner check _step5_to and _best_flee_step already apply.

tests/test_combat.py::test_ranged_no_line_of_effect_moves_around_wall
pinned the old corner-cutting step (0,1)->(1,2) past the wall at (0,2);
re-scripted for the legal (0,1)->(1,1) path (wall cover now applies).

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
2026-09-12 10:48:12 +02:00
parent 4b4e6f2726
commit e1c9e78b4e
3 changed files with 45 additions and 5 deletions
+6
View File
@@ -6130,6 +6130,12 @@ class CombatEngine:
fits = self._cells_walkable if friendly_passable else self._cells_free
for d_row, d_col in _STEP_DELTAS:
nxt = (row + d_row, col + d_col)
# PF1e (CRB, Measuring Distance): "You can't move diagonally past
# a corner (even by taking a 5-foot step)" — same corner rule the
# explicit step (``_step5_to``) and flee (``_best_flee_step``)
# paths already enforce.
if not self._grid.diagonal_allowed(current, nxt):
continue
footprint = self._footprint_at(nxt, state)
if not fits(footprint, state):
continue