From: Lukas Krickl Date: Thu, 21 Aug 2025 15:31:13 +0000 (+0200) Subject: mapgen: Fixed various small issues in door placement X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=82ea6f5304931ace2b70e058f86a0505d6083d39;p=gbrg%2F.git mapgen: Fixed various small issues in door placement --- diff --git a/src/mapgen.s b/src/mapgen.s index 04df720..043bdfc 100644 --- a/src/mapgen.s +++ b/src/mapgen.s @@ -149,11 +149,12 @@ mapgen_make_doors: ld b, 1 ld c, 1 ; bc = y/x position ; start current ptr at 1/1 as well - ld hl, map_doors_location + 1 * FLOOR_W + ld hl, map_doors_location + 1 + FLOOR_W ; set map cursor ld a, 1 + FLOOR_W ld [player_map_cursor], a + BREAK ; select how many doors we want push bc @@ -181,6 +182,7 @@ mapgen_make_doors: call make_door cp a, 0xFF jp z, @loop ; try again + BREAK call make_opp_door pop af @@ -258,7 +260,7 @@ make_door: ; try again... ld a, 0xFF ret -@right: +@left: ; can we even place it? ld a, c @@ -275,9 +277,9 @@ make_door: pop af ret -@left: +@right: ld a, c - cp a, MAP_W-1 + cp a, FLOOR_W-1 jp z, @try_again ld a, [hl] @@ -309,14 +311,14 @@ make_door: @down: ld a, b - cp a, MAP_H-1 + cp a, FLOOR_H-1 jp z, @try_again ld a, [hl] or a, DIRDOWN ld [hl], a - inc bc ; y++ + inc b ; y++ ; move hl one row down .rep i, FLOOR_W, 1, inc hl