Skip to content

Commit f92ebdc

Browse files
committed
Let CheckEitherEventSet reuse A like CheckBothEventsSet
1 parent 67084c9 commit f92ebdc

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

macros/scripts/events.asm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,9 +411,13 @@ ENDM
411411
; returns the complement of whether either event is set in Z flag
412412
;\1 = event index 1
413413
;\2 = event index 2
414+
;\3 = try to reuse a (optional)
414415
MACRO CheckEitherEventSet
415416
IF ((\1) / 8) == ((\2) / 8)
416-
ld a, [wEventFlags + ((\1) / 8)]
417+
IF (_NARG < 3) || (((\1) / 8) != event_byte)
418+
DEF event_byte = ((\1) / 8)
419+
ld a, [wEventFlags + ((\1) / 8)]
420+
ENDC
417421
and (1 << ((\1) % 8)) | (1 << ((\2) % 8))
418422
ELSE
419423
; This case doesn't happen in the original ROM.

scripts/MtMoonB2F.asm

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,7 @@ MtMoonB2FSuperNerdText:
184184
text_asm
185185
CheckEvent EVENT_BEAT_MT_MOON_EXIT_SUPER_NERD
186186
jr z, .beat_super_nerd
187-
; CheckEitherEventSetReuseA EVENT_GOT_DOME_FOSSIL, EVENT_GOT_HELIX_FOSSIL
188-
and (1 << (EVENT_GOT_DOME_FOSSIL % 8)) | (1 << (EVENT_GOT_HELIX_FOSSIL % 8))
187+
CheckEitherEventSet EVENT_GOT_DOME_FOSSIL, EVENT_GOT_HELIX_FOSSIL, 1
189188
jr nz, .got_a_fossil
190189
ld hl, MtMoonB2fSuperNerdEachTakeOneText
191190
call PrintText

0 commit comments

Comments
 (0)