Fixed inventory deductions on player 1

This commit is contained in:
blondie7575 2018-12-29 18:19:10 -07:00
parent 1179aa7678
commit 3f607350fd
2 changed files with 9 additions and 3 deletions

Binary file not shown.

View File

@ -172,6 +172,7 @@ playerDeltaPowerClampHigh:
; playerFire
;
; Y = Player index
; Trashes SCRATCHL
;
playerFire:
SAVE_AX
@ -182,11 +183,16 @@ playerFire:
pha
asl
tax
beq playerFire_infiniteAmmo
lda playerData+PD_INVENTORY,x
beq playerFire_infiniteAmmo ; Weapon 0 is always infinite
stx SCRATCHL
lda #playerData+PD_INVENTORY
clc
adc SCRATCHL
sta SCRATCHL
lda (SCRATCHL),y
beq playerFire_abort
dec ; Consume ammo
sta playerData+PD_INVENTORY,x
sta (SCRATCHL),y
dec inventoryDirty
playerFire_infiniteAmmo: