diff --git a/keydrop/standing_items.asm b/keydrop/standing_items.asm index 19db1eb..386b695 100644 --- a/keydrop/standing_items.asm +++ b/keydrop/standing_items.asm @@ -679,7 +679,8 @@ KeyGet: JSL CountChestKeyLong ++ PLA : RTL + STY $00 - LDA SprItemMWPlayer, X : STA !MULTIWORLD_ITEM_PLAYER_ID : BNE .receive + LDA SprItemMWPlayer, X : STA !MULTIWORLD_ITEM_PLAYER_ID + STA !MULTIWORLD_SPRITEITEM_PLAYER_ID : BNE .receive PHX LDA $040C : CMP #$FF : BNE + LDA $00 : CMP.b #$AF : BNE .skip @@ -696,6 +697,7 @@ KeyGet: .skip PLX .receive JSL $0791b3 ; Player_HaltDashAttackLong + TYA : JSL.l AttemptItemSubstitution : JSL.l ResolveLootIDLong : TAY JSL.l Link_ReceiveItem PLA : DEC : RTL diff --git a/newitems.asm b/newitems.asm index e5c0db4..3b6ec53 100644 --- a/newitems.asm +++ b/newitems.asm @@ -692,20 +692,15 @@ ResolveReceipt: PHA : PHX PHK : PLB JSL.l PreItemGet - LDA.l !MULTIWORLD_ITEM_PLAYER_ID : BNE + - LDA.w ItemReceiptID - .get_item + LDA.l !MULTIWORLD_ITEM_PLAYER_ID : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID + LDA.w ItemReceiptID : STA.l !MULTIWORLD_ITEM_ID JSL.l AttemptItemSubstitution JSR.w HandleBowTracking - + - LDA.w ItemReceiptID - STA.l !MULTIWORLD_ITEM_ID JSR.w ResolveLootID - .have_item STA.w ItemReceiptID LDA.l !MULTIWORLD_ITEM_PLAYER_ID : BNE + - LDA.w ItemReceiptID - JSR IncrementItemCounters + LDA.w ItemReceiptID + JSR IncrementItemCounters + PLX : PLA RTS diff --git a/shopkeeper.asm b/shopkeeper.asm index 7b9fea2..76e5680 100644 --- a/shopkeeper.asm +++ b/shopkeeper.asm @@ -464,10 +464,13 @@ Shopkeeper_BuyItem: LDA.l EnableShopItemCount, X : STA.l ShopEnableCount ; If so, store the permission to count the item here. +++ PLX - LDA.l ShopInventory, X : TAY : JSL.l Link_ReceiveItem + LDA.l ShopInventory, X + JSL.l AttemptItemSubstitution + JSL.l ResolveLootIDLong + TAY + JSL.l Link_ReceiveItem LDA.l ShopInventory+3, X : INC : STA.l ShopInventory+3, X LDA.b #0 : STA.l ShopEnableCount - TXA : LSR #2 : TAX LDA.l ShopType : BIT.b #$80 : BNE + LDA ShopkeeperRefill : BNE +++