Decomp ItemManager::SetPotion

This commit is contained in:
Aetias
2024-04-30 18:17:31 +02:00
parent 81c5e92ebc
commit a41ce23938
2 changed files with 9 additions and 28 deletions
-28
View File
@@ -3,34 +3,6 @@
.text
.global _ZN11ItemManager9SetPotionEjh
arm_func_start _ZN11ItemManager9SetPotionEjh
_ZN11ItemManager9SetPotionEjh: ; 0x020ae50c
add r3, r0, r1
strb r2, [r3, #0xbc]
cmp r2, #0
add r1, r1, #9
bne _020ae544
add r3, r0, #0x128
mov r2, r1, lsr #0x5
and r0, r1, #0x1f
mov r1, #1
mvn r0, r1, lsl r0
ldr r1, [r3, r2, lsl #2]
and r0, r1, r0
str r0, [r3, r2, lsl #2]
bx lr
_020ae544:
add ip, r0, #0x128
mov r3, r1, lsr #0x5
and r0, r1, #0x1f
ldr r2, [ip, r3, lsl #2]
mov r1, #1
orr r0, r2, r1, lsl r0
str r0, [ip, r3, lsl #2]
bx lr
arm_func_end _ZN11ItemManager9SetPotionEjh
.global _ZNK11ItemManager9HasPotionEj
arm_func_start _ZNK11ItemManager9HasPotionEj
_ZNK11ItemManager9HasPotionEj: ; 0x020ae564
+9
View File
@@ -853,3 +853,12 @@ ARM void ItemManager::func_ov00_020ae4dc(s32 param1) {
mUnk_0ba = newValue;
}
}
ARM void ItemManager::SetPotion(u32 index, Potion potion) {
mPotions[index] = potion;
if (potion == Potion_None) {
RESET_FLAG(mItemFlags.flags, index + ItemFlag_PotionA);
} else {
SET_FLAG(mItemFlags.flags, index + ItemFlag_PotionA);
}
}