summaryrefslogtreecommitdiff
path: root/src/ItemManager.cpp
diff options
context:
space:
mode:
authorAetias <aetias@outlook.com>2024-02-18 12:33:15 +0100
committerAetias <aetias@outlook.com>2024-02-18 12:33:15 +0100
commit13a132ba1352e67d7a74c3a4f922e30183ee0902 (patch)
treec9c5f21d9f2bf7837f9161bc3fbfd5c89f94c465 /src/ItemManager.cpp
parentb252bd2035d3bdc763cbbfe37c72e3a827c4c2ac (diff)
Decomp `ItemManager::GetMaxAmmo`
Diffstat (limited to 'src/ItemManager.cpp')
-rw-r--r--src/ItemManager.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/ItemManager.cpp b/src/ItemManager.cpp
index 59793b50..582e8644 100644
--- a/src/ItemManager.cpp
+++ b/src/ItemManager.cpp
@@ -322,3 +322,15 @@ THUMB void ItemManager::SetUnk_09e(u32 index, u16 value) {
this->mUnk_09e[index] = value;
}
}
+
+const u16 sQuiverSizes[] = {20, 20, 30, 50};
+const u16 sBombBagSizes[] = {10, 20, 30};
+
+THUMB u16 ItemManager::GetMaxAmmo(ItemFlag equipId) const {
+ switch (equipId) {
+ case ItemFlag_Bow: return (sQuiverSizes + 1)[this->mQuiverSize];
+ case ItemFlag_BombBag: return sBombBagSizes[this->mBombBagSize];
+ case ItemFlag_BombchuBag: return sBombBagSizes[this->mBombchuBagSize];
+ default: return 1;
+ }
+}