diff options
| author | Aetias <aetias@outlook.com> | 2024-02-17 00:53:22 +0100 |
|---|---|---|
| committer | Aetias <aetias@outlook.com> | 2024-02-17 00:53:22 +0100 |
| commit | 3a25fcc17dbb9548c979980f4a94fcc32251dfb3 (patch) | |
| tree | e614b241b5a899a07c64408c97a53ec5a2aae563 /src/ItemManager.cpp | |
| parent | ef2226c84d280a418bc0ed82f6fa1f371bafbb0f (diff) | |
Decomp `ItemManager::GiveAmmo`
Diffstat (limited to 'src/ItemManager.cpp')
| -rw-r--r-- | src/ItemManager.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ItemManager.cpp b/src/ItemManager.cpp index 33be3fc0..a946c3f7 100644 --- a/src/ItemManager.cpp +++ b/src/ItemManager.cpp @@ -267,3 +267,9 @@ u16 ItemManager::GetAmmo(ItemFlag equipId) const { return (*this->mAmmo)[equipId];
}
#pragma interworking off
+
+void ItemManager::GiveAmmo(ItemFlag equipId, u16 amount) {
+ (*this->mAmmo)[equipId] += amount;
+ if ((*this->mAmmo)[equipId] <= this->GetMaxAmmo(equipId)) return;
+ (*this->mAmmo)[equipId] = this->GetMaxAmmo(equipId);
+}
|
