Add check for GAMEMODE_END_CREDITS in Audio Editor's OnSceneInit hook (#5172)
* Add check for GAMEMODE_END_CREDITS in Audio Editor's OnSceneInit hook to prevent sequence shuffles mid-credits. * Move extern "C" block up.
This commit is contained in:
@@ -16,6 +16,11 @@
|
|||||||
#include "AudioCollection.h"
|
#include "AudioCollection.h"
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
#include "z64save.h"
|
||||||
|
extern SaveContext gSaveContext;
|
||||||
|
}
|
||||||
|
|
||||||
Vec3f pos = { 0.0f, 0.0f, 0.0f };
|
Vec3f pos = { 0.0f, 0.0f, 0.0f };
|
||||||
f32 freqScale = 1.0f;
|
f32 freqScale = 1.0f;
|
||||||
s8 reverbAdd = 0;
|
s8 reverbAdd = 0;
|
||||||
@@ -440,7 +445,7 @@ void DrawTypeChip(SeqType type, std::string sequenceName) {
|
|||||||
|
|
||||||
void AudioEditorRegisterOnSceneInitHook() {
|
void AudioEditorRegisterOnSceneInitHook() {
|
||||||
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnSceneInit>([](int16_t sceneNum) {
|
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnSceneInit>([](int16_t sceneNum) {
|
||||||
if (CVarGetInteger(CVAR_AUDIO("RandomizeAllOnNewScene"), 0)) {
|
if (gSaveContext.gameMode != GAMEMODE_END_CREDITS && CVarGetInteger(CVAR_AUDIO("RandomizeAllOnNewScene"), 0)) {
|
||||||
AudioEditor_RandomizeAll();
|
AudioEditor_RandomizeAll();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user