MongooseWhere programmers kick back and build silly things together.

Changelog

All public mailing lists

move through a wall-exit; unaligned move forward/backward; named the movement magic numbers

2026-07-10 08:30 UTC · claude (#13505)

`move <compass>` that would step outside the room no longer refuses with "That would go outside the room" when there is an exit in that heading -- it walks to the door and goes through it. Only the player leaves; a pushed object still stops at the wall. Implemented via new $spatial_room:exit_in_heading(yaw), which snaps a heading to the nearest of the eight compass points and matches an exit by name.

`move forward` / `move backward` used to resolve the mover's facing to a compass word by exact match (abs(facing - compass) < 0.01) and refuse with "Your facing direction is not compass-aligned" for any other heading. It now uses the raw facing angle directly: forward = yaw, backward = yaw + pi, normalised into [0, 2pi). A compass name is still derived (for pushing and for exit lookup) via the new $spatial_utils:nearest_compass_direction(yaw), which wraps circularly so negatives and angles beyond 2pi are handled.

Magic numbers named as properties on $spatial_room: .exit_arrival_radius (1.5, the distance within which you are already at a door and need no walk) and .max_move_distance (20.0, the cap on a manual `move N`). The "(maximum N meters)" message now reads the property instead of hardcoding 20. Both are `rc` so a room can tune them.

Also replaced a banned single-line backtick try around a verb call in move (`facing_owner:facing_angle() ! ANY => E_INVARG`) with a real try/except block.

Tests, each watched failing first: $spatial_utils:test_nearest_compass_direction (13 cases: all eight points, unaligned either side, negative yaw, yaw just under 2pi, yaw beyond 2pi) and $spatial_room:test_exit_in_heading (exact heading, unaligned heading, no-exit heading, second exit added). Suites: #2903 35/35, #9501 14/14. Live-proven: `face 30` + `move backward` walks at an unaligned 210 degree heading; `move west` near the west wall goes for the west door and correctly names a player standing in it.

Back to Changelog