Routes are walked without re-checking collision #22
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A route is computed once, when the click is handled, and then walked without
being looked at again.
World.step_player/2takes the tiles fromWorld.Movement.stride/3and consults onlyWorld.MovementAuthority.claim/4,which is entity occupancy — never terrain.
So anything that changes the world between the click and the last step is not
noticed. A door closed behind a player mid-walk, a loc added by a script, a
region whose diffs were replayed — the player walks through it.
audit_walk/3will log
stepped through collisionand nothing will stop it.Today the only thing that mutates collision at runtime is a door swap, so the
window is small and the consequence is one tile. It gets wider with every
feature that adds or removes a loc.
Shape of a fix
Validate each tile in the stride against
World.Collision.step?/2beforeclaiming it, and drop the rest of the path when one fails. That is the same
predicate the route was built with, so it costs two map reads per step and can
only reject steps that have genuinely become illegal.