summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAetias <aetias@outlook.com>2024-04-18 19:54:58 +0200
committerAetias <aetias@outlook.com>2024-04-18 19:54:58 +0200
commitb60ce0d48d9a39ce4cc5b51ef1af4b4736a2feff (patch)
tree45c6f00970c03435ef3cef5e861ab4fa4e0eedea
parent711cfc7da247d49511e49beba40972baccc0b300 (diff)
Decomp `ItemManager::UnequipPotion`
-rw-r--r--asm/ov00/Item/ItemManager.s18
-rw-r--r--src/00_Core/Item/ItemManager.cpp9
2 files changed, 10 insertions, 17 deletions
diff --git a/asm/ov00/Item/ItemManager.s b/asm/ov00/Item/ItemManager.s
index b530a3a7..6edb34ce 100644
--- a/asm/ov00/Item/ItemManager.s
+++ b/asm/ov00/Item/ItemManager.s
@@ -3,22 +3,6 @@
.text
- .global _ZN11ItemManager13UnequipPotionEv
- thumb_func_start _ZN11ItemManager13UnequipPotionEv
-_ZN11ItemManager13UnequipPotionEv: ; 0x020ae2c0
- push {r3, lr}
- ldr r1, [r0]
- cmp r1, #9
- beq _020ae2cc
- cmp r1, #0xa
- bne _020ae2d0
-_020ae2cc:
- blx _ZN11ItemManager17EquipPreviousItemEv
-_020ae2d0:
- pop {r3, pc}
- .align 2, 0
- thumb_func_end _ZN11ItemManager13UnequipPotionEv
-
.global _ZNK11ItemManager12GetMaxRupeesEv
arm_func_start _ZNK11ItemManager12GetMaxRupeesEv
_ZNK11ItemManager12GetMaxRupeesEv: ; 0x020ae2d4
@@ -132,7 +116,7 @@ _ZN11ItemManager17EquipPreviousItemEv: ; 0x020ae3c0
bx ip
.align 2, 0
arm_func_end _ZN11ItemManager17EquipPreviousItemEv
-_020ae3cc: .word _ZN11ItemManager15SetEquippedItemEi - 1
+_020ae3cc: .word _ZN11ItemManager15SetEquippedItemEi
.global _ZN11ItemManager13ForceEquipItemEi
thumb_func_start _ZN11ItemManager13ForceEquipItemEi
diff --git a/src/00_Core/Item/ItemManager.cpp b/src/00_Core/Item/ItemManager.cpp
index 93a6f25a..6228e437 100644
--- a/src/00_Core/Item/ItemManager.cpp
+++ b/src/00_Core/Item/ItemManager.cpp
@@ -747,3 +747,12 @@ THUMB void ItemManager::GiveEquipItem(ItemFlag item, u16 ammo) {
this->mEquipLoadTimer = 1;
}
}
+
+THUMB void ItemManager::UnequipPotion() {
+ switch (mEquippedItem) {
+ case ItemFlag_PotionA:
+ case ItemFlag_PotionB: {
+ this->EquipPreviousItem();
+ } break;
+ }
+}