mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-08-21 14:55:27 -04:00
Added small key null checks. (#7019)
This commit is contained in:
@@ -99,6 +99,10 @@ RandomizerSettingKey DungeonInfo::GetMQSetting() const {
|
||||
}
|
||||
|
||||
int8_t FindUsedSmallKeys(const SaveContext* saveContext, const SceneID scene, const std::vector<uint8_t>* DoorFlags) {
|
||||
if (DoorFlags == nullptr) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Get the swch value for the scene
|
||||
uint32_t swch;
|
||||
if (gPlayState != nullptr && gPlayState->sceneNum == scene) {
|
||||
|
||||
@@ -2699,7 +2699,11 @@ int8_t Logic::GetSmallKeyCount(SceneID sceneId) {
|
||||
return FindTotalSmallKeys(mSaveContext, SCENE_THIEVES_HIDEOUT, &DoorFlags);
|
||||
}
|
||||
|
||||
return Rando::Context::GetInstance()->GetDungeons()->GetDungeonFromScene(sceneId)->GetTotalSmallKeys(mSaveContext);
|
||||
if (auto* dungeon = Rando::Context::GetInstance()->GetDungeons()->GetDungeonFromScene(sceneId)) {
|
||||
return dungeon->GetTotalSmallKeys(mSaveContext);
|
||||
}
|
||||
|
||||
return FindTotalSmallKeys(mSaveContext, sceneId, nullptr);
|
||||
}
|
||||
|
||||
void Logic::SetSmallKeyCount(uint32_t dungeonIndex, uint8_t count) {
|
||||
|
||||
Reference in New Issue
Block a user