Decomp ItemManager::HasAllPotions

This commit is contained in:
Aetias
2024-04-30 18:23:19 +02:00
parent 74a07a6992
commit 028207d6a8
3 changed files with 12 additions and 25 deletions
+10 -3
View File
@@ -653,7 +653,7 @@ THUMB void ItemManager::GiveItem(ItemId id) {
} break;
case ItemId_RedPotion: {
for (s32 i = 0; i < 2; ++i) {
for (s32 i = 0; i < MAX_POTIONS; ++i) {
if (mPotions[i] != Potion_None) continue;
this->SetPotion(i, Potion_Red);
break;
@@ -661,7 +661,7 @@ THUMB void ItemManager::GiveItem(ItemId id) {
} break;
case ItemId_PurplePotion: {
for (s32 i = 0; i < 2; ++i) {
for (s32 i = 0; i < MAX_POTIONS; ++i) {
if (mPotions[i] != Potion_None) continue;
this->SetPotion(i, Potion_Purple);
break;
@@ -669,7 +669,7 @@ THUMB void ItemManager::GiveItem(ItemId id) {
} break;
case ItemId_YellowPotion: {
for (s32 i = 0; i < 2; ++i) {
for (s32 i = 0; i < MAX_POTIONS; ++i) {
if (mPotions[i] != Potion_None) continue;
this->SetPotion(i, Potion_Yellow);
break;
@@ -875,3 +875,10 @@ ARM bool ItemManager::HasPotion(u32 index) const {
return false;
}
}
ARM bool ItemManager::HasAllPotions() const {
for (s32 i = 0; i < MAX_POTIONS; ++i) {
if (!this->HasPotion(i)) return false;
}
return true;
}