aboutsummaryrefslogtreecommitdiffstats
path: root/engine/get_bag_item_quantity.asm
blob: 1540f7b11c70d8631d4c9a75e148c555c05d2bab (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
GetQuantityOfItemInBag: ; f735 (3:7735)
; In: b = item ID
; Out: b = how many of that item are in the bag
	call GetPredefRegisters
	ld hl, wNumBagItems
.loop
	inc hl
	ld a, [hli]
	cp $ff
	jr z, .notInBag
	cp b
	jr nz, .loop
	ld a, [hl]
	ld b, a
	ret
.notInBag
	ld b, 0
	ret