diff options
| author | robojumper <robojumper@gmail.com> | 2025-03-09 21:15:53 +0100 |
|---|---|---|
| committer | robojumper <robojumper@gmail.com> | 2025-03-09 21:15:53 +0100 |
| commit | 31c9b92798c499a3b3ac3c7f7c0dc61546cc0603 (patch) | |
| tree | f9d8c5a31a361e49816da5bc3d07d064dd01f376 /src/d/a/d_a_item.cpp | |
| parent | a507d8fc0ae4c1ec2cf86dc412efe2bf6fd4bac1 (diff) | |
Convert some singleton access to getters
Diffstat (limited to 'src/d/a/d_a_item.cpp')
| -rw-r--r-- | src/d/a/d_a_item.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/d/a/d_a_item.cpp b/src/d/a/d_a_item.cpp index d49b3ecf..56ee740f 100644 --- a/src/d/a/d_a_item.cpp +++ b/src/d/a/d_a_item.cpp @@ -272,12 +272,10 @@ bool dAcItemBase_c::setDungeonFlagForTear(int tearNum) { if (!getFlagIdxForTear(tearNum, &flag_idx)) { return false; } - // idk - int idx = DungeonflagManager::sInstance->mStageIndex; - const u16 *pData = FileManager::sInstance->getDungeonFlagsConst() + ((idx & 0x1FFF) * 4); - u32 counterMask = DungeonflagManager::sInstance->mpFlagIndex->getCounterOrFlag(flag_idx, pData, 8); - u32 tearMask = getTearBit(tearNum); - DungeonflagManager::sInstance->setToValue(flag_idx, tearMask | counterMask); + u16 oldVal = DungeonflagManager::sInstance->getCounterOrFlag(flag_idx, 8); + u16 tearBit = getTearBit(tearNum); + u16 newVal = tearBit | oldVal; + DungeonflagManager::sInstance->setToValue(flag_idx, newVal); return true; } |
