diff options
| author | Aetias <aetias@outlook.com> | 2024-04-30 18:23:19 +0200 |
|---|---|---|
| committer | Aetias <aetias@outlook.com> | 2024-04-30 18:23:19 +0200 |
| commit | 028207d6a8cc7bd88afb51cefd8bdd749993b00d (patch) | |
| tree | 28645a24403290193576061636e213ba811d1614 /src/00_Core/Item/ItemManager.cpp | |
| parent | 74a07a6992129cdaad37c649e03a32fe33450a7b (diff) | |
Decomp `ItemManager::HasAllPotions`
Diffstat (limited to 'src/00_Core/Item/ItemManager.cpp')
| -rw-r--r-- | src/00_Core/Item/ItemManager.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/00_Core/Item/ItemManager.cpp b/src/00_Core/Item/ItemManager.cpp index 3aedc0b3..ea9d1f34 100644 --- a/src/00_Core/Item/ItemManager.cpp +++ b/src/00_Core/Item/ItemManager.cpp @@ -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;
+}
|
