randomizer_check_tracker: small cleanup (#6480)

This commit is contained in:
Philip Dubé 2026-04-10 16:37:22 +00:00 committed by GitHub
parent 9945041888
commit c879c97066
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -25,7 +25,6 @@
#include "item_location.h" #include "item_location.h"
#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "z64item.h" #include "z64item.h"
#include "fishsanity.h"
extern "C" { extern "C" {
#include "variables.h" #include "variables.h"
@ -475,14 +474,9 @@ RandomizerCheckArea GetCheckArea() {
return area; return area;
} }
bool vector_contains_scene(std::vector<SceneID> vec, const int16_t scene) { std::array<SceneID, 4> skipScenes = {
return std::any_of(vec.begin(), vec.end(), [&](const auto& x) { return x == scene; });
}
std::vector<SceneID> skipScenes = {
SCENE_GANON_BOSS, SCENE_GANON_BOSS,
SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR, SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR,
SCENE_GANON_BOSS,
SCENE_INSIDE_GANONS_CASTLE_COLLAPSE, SCENE_INSIDE_GANONS_CASTLE_COLLAPSE,
SCENE_GANONS_TOWER_COLLAPSE_INTERIOR, SCENE_GANONS_TOWER_COLLAPSE_INTERIOR,
}; };
@ -659,7 +653,8 @@ void CheckTrackerTransition(uint32_t sceneNum) {
} }
void CheckTrackerItemReceive(GetItemEntry giEntry) { void CheckTrackerItemReceive(GetItemEntry giEntry) {
if (!GameInteractor::IsSaveLoaded() || vector_contains_scene(skipScenes, gPlayState->sceneNum)) { if (!GameInteractor::IsSaveLoaded() || std::find(std::begin(skipScenes), std::end(skipScenes),
(SceneID)gPlayState->sceneNum) != std::end(skipScenes)) {
return; return;
} }
auto scene = static_cast<SceneID>(gPlayState->sceneNum); auto scene = static_cast<SceneID>(gPlayState->sceneNum);