Decomp ItemManager::HasPotion

This commit is contained in:
Aetias
2024-04-30 18:21:11 +02:00
parent a41ce23938
commit 74a07a6992
3 changed files with 14 additions and 24 deletions
+1 -3
View File
@@ -1,7 +1,5 @@
#pragma once
.extern _ZN11ItemManager12GetEquipItemEi
.extern _ZN11ItemManager15SetEquippedItemEi
.extern _ZNK11ItemManager10GetMaxAmmoEi
.extern _ZNK11ItemManager9HasPotionEj
.extern data_027e0f78
.extern data_ov00_020eec68
.extern func_020196bc
-21
View File
@@ -3,27 +3,6 @@
.text
.global _ZNK11ItemManager9HasPotionEj
arm_func_start _ZNK11ItemManager9HasPotionEj
_ZNK11ItemManager9HasPotionEj: ; 0x020ae564
add r0, r0, r1
ldrb r0, [r0, #0xbc]
cmp r0, #3
addls pc, pc, r0, lsl #2
b _020ae590
_020ae578: ; jump table
b _020ae590 ; case 0
b _020ae588 ; case 1
b _020ae588 ; case 2
b _020ae588 ; case 3
_020ae588:
mov r0, #1
bx lr
_020ae590:
mov r0, #0
bx lr
arm_func_end _ZNK11ItemManager9HasPotionEj
.global _ZNK11ItemManager13HasAllPotionsEv
arm_func_start _ZNK11ItemManager13HasAllPotionsEv
_ZNK11ItemManager13HasAllPotionsEv: ; 0x020ae598
+13
View File
@@ -862,3 +862,16 @@ ARM void ItemManager::SetPotion(u32 index, Potion potion) {
SET_FLAG(mItemFlags.flags, index + ItemFlag_PotionA);
}
}
ARM bool ItemManager::HasPotion(u32 index) const {
switch (mPotions[index]) {
case Potion_Red:
case Potion_Purple:
case Potion_Yellow:
return true;
case Potion_None:
default:
return false;
}
}