From 4a2a637ba6f7713d101c6dbb8e3acfc3cb3ec6e5 Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Sat, 25 Jan 2025 06:51:52 +0100 Subject: [PATCH] map: Fixed de not being preserved when re-trying room door placement --- src/map.s | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/map.s b/src/map.s index 24a6ce9..5849584 100644 --- a/src/map.s +++ b/src/map.s @@ -631,6 +631,9 @@ map_gen_pick_direction: ld hl, roomb_exits add hl, de ; hl = room exit struct + ; de needs to be saved + push de + add a, a ; a * 2 = ptr offset ld d, 0 ld e, a @@ -645,6 +648,7 @@ map_gen_pick_direction: ld e, a ld a, [hl] add a, e ; this must be 0 + pop de ; get de back before jumping :^) cp a, 0 jr nz, @again REL -- 2.30.2