mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-04-28 21:27:58 +03:00
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:
parent
57bc5690e2
commit
e21a3e4c0f
1 changed files with 6 additions and 1 deletions
|
@ -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();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue