mirror of
https://github.com/bryanthaboi/gen1recomp
synced 2026-09-26 13:33:27 -04:00
89c7959c70
Collision.installWarps force-marked every map-header warp cell walkable. That is right for the outdoor MB_WARP_DOOR tiles extract can leave solid, but it also opened cells that only carry a dead warp event. PalletTown_PlayersHouse_1F has one at (3,9): the wall tile directly left of the door mat, mid 26, coll 1, behavior 0x00 MB_NORMAL. pret never lets the player stand there, so the warp never fires; the forced COLL_DOOR let the player walk out of the house through the wall and land in PalletTown. The repair now fires only when the behavior is unreadable (tileset attrs stopped before that mid, so Collision.behavior returns nil) or is a behavior pret would actually warp on. Collision.isWarpMetatileBehavior covers 0x60-0x6F plus 0x71, matching field_control_avatar.c: the arrow warps (TryArrowWarp), the directional stair warps (IsDirectionalStairWarpMetatileBehavior), and everything IsWarpMetatileBehavior accepts (cave door, ladder, fall warp, regular warp, Lavaridge 1F warp, warp door, escalators, union-room warp). Warp indexing is unchanged: a dead warp on a wall is still registered, only the grid write is gated. tests/engine/firered_house_wall_warp_bug2297.lua is ROM-free: it embeds the pret 13x10 map.bin grid and the `building` metatile attributes, translates them with the real ScriptingCollision.fromCell, binds the real Versions.WARPS table, and asserts the wall stays solid, the four warp cells still behave, the repair still applies for unreadable attrs and live warp behaviors, and an exhaustive 0x00-0xFF table pins the predicate. It fails 6 checks against the pre-fix file. luajit tests/run_engine.lua: 585/585 suites passed. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>