From c0dff8e7c96d876833337ea6597e77f743e00095 Mon Sep 17 00:00:00 2001 From: aerinon Date: Wed, 13 Sep 2023 14:28:18 -0600 Subject: [PATCH] Bugfixes for duping/disappearing item and mutliworld crash --- inventory.asm | 3 ++- keydrop/standing_items.asm | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/inventory.asm b/inventory.asm index fee8b5f..d07d986 100644 --- a/inventory.asm +++ b/inventory.asm @@ -147,8 +147,8 @@ AddInventory: PHA : PHX : PHY : PHP : PHB PHK : PLB LDA.b #$7E : STA.b Scrap0D - LDA.l !MULTIWORLD_ITEM_PLAYER_ID : BNE .countDungeonChecks LDA.l StatsLocked : BNE .done + LDA.l !MULTIWORLD_ITEM_PLAYER_ID : BNE .countDungeonChecks REP #$30 TYA : AND.w #$00FF : ASL : TAX SEP #$20 @@ -216,6 +216,7 @@ RTS DungeonIncrement: ; In: X - Receipt ID << 1 + REP #$10 PHX LDA.l !MULTIWORLD_RECEIVING_ITEM : BNE .done LDA.w InventoryTable_properties,X : BIT.b #$40 : BEQ + diff --git a/keydrop/standing_items.asm b/keydrop/standing_items.asm index ce91e75..7f06e63 100644 --- a/keydrop/standing_items.asm +++ b/keydrop/standing_items.asm @@ -585,7 +585,7 @@ ShouldSpawnItem: PHX TAX : LDA.l BitFieldMasks, X : STA $00 PLX ; restore X again - LDA.w SprItemFlags, X : BIT.w #$0001 : BEQ + + LDA.w SprItemFlags, X : BIT.w #$0001 : BNE + TYX : LDA.l SpriteDropData, X : BIT $00 : BEQ .notObtained BRA .obtained + TYX : LDA.l RoomPotData, X : BIT $00 : BEQ .notObtained @@ -597,7 +597,7 @@ ShouldSpawnItem: RTL MarkSRAMForItem: - LDA $048E : CMP.b #$87 : BNE + ; check for hera basement cage + LDA.b RoomIndex : CMP.b #$87 : BNE + ; check for hera basement cage CPX #$0A : BNE + ; the hera basement key is always sprite 0x0A LDA $A8 : AND.b #$03 : CMP.b #$02 : BNE + LDA.w $0403 : ORA.w KeyRoomFlagMasks, Y : RTL