summaryrefslogtreecommitdiff
path: root/src/00_Core/Item/ItemManager.cpp
diff options
context:
space:
mode:
authorAetias <aetias@outlook.com>2024-04-30 17:49:06 +0200
committerAetias <aetias@outlook.com>2024-04-30 17:49:06 +0200
commit86889daa658ee09a7a76008627aeeeb9f25cb365 (patch)
tree4270da786da2e41ee1095b92d1ffd7ecb9c29c46 /src/00_Core/Item/ItemManager.cpp
parenta6896a0bc57ae2efa50f71ecd6fdc598969b7acb (diff)
Decomp `ItemManager::GiveKeys`
Diffstat (limited to 'src/00_Core/Item/ItemManager.cpp')
-rw-r--r--src/00_Core/Item/ItemManager.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/00_Core/Item/ItemManager.cpp b/src/00_Core/Item/ItemManager.cpp
index baf6e76b..ac550e81 100644
--- a/src/00_Core/Item/ItemManager.cpp
+++ b/src/00_Core/Item/ItemManager.cpp
@@ -1,5 +1,4 @@
#include "Item/ItemManager.hpp"
-#include "Map/MapManager.hpp"
extern u32 *data_027e0ce0[];
@@ -785,3 +784,10 @@ ARM void ItemManager::GiveRupees(s16 amount, bool param2) {
ARM unk32 ItemManager::GetNumKeys() const {
return gMapManager->GetNumKeys();
}
+
+THUMB void ItemManager::GiveKeys(u32 amount) {
+ s32 keys = amount + gMapManager->GetNumKeys();
+ if (keys >= MAX_KEYS) keys = MAX_KEYS;
+ if (keys <= 0) keys = 0;
+ gMapManager->SetNumKeys(keys);
+}