mirror of
https://github.com/zeldaret/ph
synced 2026-07-11 22:40:17 -04:00
Decomp ItemManager::HasAllPotions
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user