From ad632621c1f173bd39efd89d3d689c39a98c0a71 Mon Sep 17 00:00:00 2001 From: acamilo Date: Tue, 22 Sep 2026 17:44:53 +0000 Subject: [PATCH] macros: say when the step reading narrows to None --- services/flysim/crates/flybrain-gb/src/pokemon_red/state.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/flysim/crates/flybrain-gb/src/pokemon_red/state.rs b/services/flysim/crates/flybrain-gb/src/pokemon_red/state.rs index b77feea..0bd3e43 100644 --- a/services/flysim/crates/flybrain-gb/src/pokemon_red/state.rs +++ b/services/flysim/crates/flybrain-gb/src/pokemon_red/state.rs @@ -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()?;