mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-20 13:23:45 -07:00
Updated GetSmallKeyCount to return int8_t.
This commit is contained in:
parent
b82e3110c6
commit
99e1a1e036
2 changed files with 6 additions and 6 deletions
|
@ -2171,7 +2171,7 @@ namespace Rando {
|
||||||
return dungeonSmallKeyDoors[key];
|
return dungeonSmallKeyDoors[key];
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t GetUsedSmallKeyCount(SceneID sceneId) {
|
int8_t GetUsedSmallKeyCount(SceneID sceneId) {
|
||||||
const auto& smallKeyDoors = GetDungeonSmallKeyDoors(sceneId);
|
const auto& smallKeyDoors = GetDungeonSmallKeyDoors(sceneId);
|
||||||
|
|
||||||
// Get the swch value for the scene
|
// Get the swch value for the scene
|
||||||
|
@ -2183,7 +2183,7 @@ namespace Rando {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Count the number of small keys doors unlocked
|
// Count the number of small keys doors unlocked
|
||||||
uint8_t unlockedSmallKeyDoors = 0;
|
int8_t unlockedSmallKeyDoors = 0;
|
||||||
for (auto& smallKeyDoor : smallKeyDoors) {
|
for (auto& smallKeyDoor : smallKeyDoors) {
|
||||||
unlockedSmallKeyDoors += swch >> smallKeyDoor & 1;
|
unlockedSmallKeyDoors += swch >> smallKeyDoor & 1;
|
||||||
}
|
}
|
||||||
|
@ -2191,11 +2191,11 @@ namespace Rando {
|
||||||
return unlockedSmallKeyDoors;
|
return unlockedSmallKeyDoors;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t Logic::GetSmallKeyCount(uint32_t dungeonIndex) {
|
int8_t Logic::GetSmallKeyCount(uint32_t dungeonIndex) {
|
||||||
return mSaveContext->inventory.dungeonKeys[dungeonIndex] + GetUsedSmallKeyCount(SceneID(dungeonIndex));
|
return mSaveContext->inventory.dungeonKeys[dungeonIndex] + GetUsedSmallKeyCount(SceneID(dungeonIndex));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Logic::SetSmallKeyCount(uint32_t dungeonIndex, uint8_t count) {
|
void Logic::SetSmallKeyCount(uint32_t dungeonIndex, int8_t count) {
|
||||||
mSaveContext->inventory.dungeonKeys[dungeonIndex] = count;
|
mSaveContext->inventory.dungeonKeys[dungeonIndex] = count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -260,8 +260,8 @@ class Logic {
|
||||||
bool CheckEquipment(uint32_t item);
|
bool CheckEquipment(uint32_t item);
|
||||||
bool CheckQuestItem(uint32_t item);
|
bool CheckQuestItem(uint32_t item);
|
||||||
void SetQuestItem(uint32_t item, bool state);
|
void SetQuestItem(uint32_t item, bool state);
|
||||||
uint8_t GetSmallKeyCount(uint32_t dungeonIndex);
|
int8_t GetSmallKeyCount(uint32_t dungeonIndex);
|
||||||
void SetSmallKeyCount(uint32_t dungeonIndex, uint8_t count);
|
void SetSmallKeyCount(uint32_t dungeonIndex, int8_t count);
|
||||||
bool CheckDungeonItem(uint32_t item, uint32_t dungeonIndex);
|
bool CheckDungeonItem(uint32_t item, uint32_t dungeonIndex);
|
||||||
void SetDungeonItem(uint32_t item, uint32_t dungeonIndex, bool state);
|
void SetDungeonItem(uint32_t item, uint32_t dungeonIndex, bool state);
|
||||||
bool CheckRandoInf(uint32_t flag);
|
bool CheckRandoInf(uint32_t flag);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue