mirror of
https://github.com/zeldaret/ph
synced 2026-05-31 17:31:57 -04:00
Decomp ItemManager::HasPotion
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
#pragma once
|
||||
.extern _ZN11ItemManager12GetEquipItemEi
|
||||
.extern _ZN11ItemManager15SetEquippedItemEi
|
||||
.extern _ZNK11ItemManager10GetMaxAmmoEi
|
||||
.extern _ZNK11ItemManager9HasPotionEj
|
||||
.extern data_027e0f78
|
||||
.extern data_ov00_020eec68
|
||||
.extern func_020196bc
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user