Fix issue #581 (random stuff ax6 noticed)

This commit is contained in:
Rangi
2018-12-23 03:45:41 -05:00
parent 83ff516c82
commit f6ecb681d5
2 changed files with 32 additions and 31 deletions

View File

@@ -11,17 +11,17 @@ EngineFlagAction::
; to know that the infrastructure is there.
ld a, d
cp 0
cp HIGH(NUM_ENGINE_FLAGS)
jr z, .ceiling
jr c, .read ; cp 0 can't set carry!
jr .invalid
; There are only $a2 engine flags, so
; There are only NUM_ENGINE_FLAGS engine flags, so
; anything beyond that is invalid too.
.ceiling
ld a, e
cp NUM_ENGINE_FLAGS
cp LOW(NUM_ENGINE_FLAGS)
jr c, .read
; Invalid flags are treated as flag 00.