Skip to content

Commit f921ad1

Browse files
authored
Merge pull request #57 from skx/48-rug
Bugfix: Examining rug shouldn't always trigger behaviour
2 parents debb663 + 04f19a0 commit f921ad1

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

game.z80

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
; string. e.g. User types "EXAMINE" we run "examine_function"
3737
;
3838
; * All object-specific functions have a _fn suffix.
39-
; e.g. Custom code runs when you "GET RUG" is get_rug_fn
39+
; e.g. Custom code runs when you "TAKE RUG" is take_rug_fn
4040
;
4141
; If you're using Emacs, or similar editor, you should be able to fold
4242
; or collapse sections of the code via the markers "; {" and "; }"
@@ -2379,14 +2379,22 @@ examine_rug_fn:
23792379

23802380
; The rug must be in your possession, just show the extended
23812381
; description.
2382+
just_show_rug_details:
23822383
ld e, (IX+ITEM_TABLE_EXT_DESCRIPTION_OFFSET)
23832384
ld d, (IX+ITEM_TABLE_EXT_DESCRIPTION_OFFSET+1)
23842385
call bios_output_string
23852386

23862387
ret
23872388

23882389
rug_on_ground:
2390+
;; If we're in the ground-floor we can show more details
2391+
;; if we're not we'll just show the overview
2392+
ld hl, CURRENT_LOCATION
2393+
ld a,(hl)
2394+
cp 2
2395+
jr nz, just_show_rug_details
23892396

2397+
;; We're in the ground floor so we can do the reveal
23902398
ld de, rug_detail_msg
23912399
call bios_output_string
23922400
call make_trapdoor_visible

0 commit comments

Comments
 (0)