Skip to content

Commit

Permalink
BUGFIX: Second victory path.
Browse files Browse the repository at this point in the history
If you weren't carrying the magic-item you couldn't go up from the
middle-floor, as our HL pointer to the CURRENT_LOCATION was
trashed.
  • Loading branch information
skx committed Apr 28, 2021
1 parent 667aa3c commit c1d32ab
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions game.z80
Original file line number Diff line number Diff line change
Expand Up @@ -1805,7 +1805,7 @@ up_function:
jr z, up_on_dark_room ; go up two - to land in ground floor

up_on_middle_floor:
; Are we carrying the meteor?
; Get the meteor?
ld hl, item_13_name
call get_item_by_name

Expand All @@ -1816,12 +1816,12 @@ up_on_middle_floor:
ld a, (hl)
pop hl

; Are we carrying the item
; Are we carrying the item?
cp 255
jr nz, up_on_ground_floor

; We're on the middle-floor, going up, carrying the meteor.
; That's a victory.
; That's an easy victory.
ld hl, PLAYER_WON
inc (hl)

Expand All @@ -1836,11 +1836,13 @@ no_up:
ret

up_on_dark_room:
ld hl, CURRENT_LOCATION
dec (hl)
; fall-through

up_on_ground_floor:
up_on_basement_floor:
ld hl, CURRENT_LOCATION
dec (hl)
call look_function
ret
Expand Down

0 comments on commit c1d32ab

Please sign in to comment.