macros: say when the step reading narrows to None
This commit is contained in:
parent
95d3d56d3f
commit
ad632621c1
1 changed files with 5 additions and 0 deletions
|
|
@ -1019,6 +1019,11 @@ fn screen_anchor(
|
|||
///
|
||||
/// A step that has begun always finishes -- the cartridge owns the animation and no press stops it
|
||||
/// -- so the tile the screen has already centred on is ground this run has covered.
|
||||
///
|
||||
/// It answers `None` on a mid-step frame whose neighbourhood is the same tile id in every
|
||||
/// direction, because [`ANCHORS`] tries the standing anchor first and an open field agrees under
|
||||
/// it. That is the safe way round: the grid served is still the right one, and the tile is
|
||||
/// recorded on the frame the step lands, as it was before.
|
||||
pub fn step_destination(memory: &mut dyn MemoryReader, grid: &MapGrid) -> Option<(u8, u8)> {
|
||||
let player = player(memory)?;
|
||||
let (dx, dy) = screen_anchor(memory, grid, player.x, player.y).ok()?;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue