mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-22 01:12:19 -05:00
fix warp override mq mode room loads (#3019)
This commit is contained in:
parent
d4ff05f51d
commit
39349d8512
@ -24,6 +24,8 @@ void BootCommands_Init()
|
|||||||
CVarClear("gRandoGenerating"); // Clear when a crash happened during rando seed generation
|
CVarClear("gRandoGenerating"); // Clear when a crash happened during rando seed generation
|
||||||
CVarClear("gNewSeedGenerated");
|
CVarClear("gNewSeedGenerated");
|
||||||
CVarClear("gOnFileSelectNameEntry"); // Clear when soh is killed on the file name entry page
|
CVarClear("gOnFileSelectNameEntry"); // Clear when soh is killed on the file name entry page
|
||||||
|
CVarClear("gBetterDebugWarpScreenMQMode");
|
||||||
|
CVarClear("gBetterDebugWarpScreenMQModeScene");
|
||||||
#if defined(__SWITCH__) || defined(__WIIU__)
|
#if defined(__SWITCH__) || defined(__WIIU__)
|
||||||
CVarRegisterInteger("gControlNav", 1); // always enable controller nav on switch/wii u
|
CVarRegisterInteger("gControlNav", 1); // always enable controller nav on switch/wii u
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
typedef enum {
|
||||||
|
WARP_MODE_OVERRIDE_OFF,
|
||||||
|
WARP_MODE_OVERRIDE_MQ_AS_VANILLA,
|
||||||
|
WARP_MODE_OVERRIDE_VANILLA_AS_MQ,
|
||||||
|
} BetterDebugWarpOverrideMQMode;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
CSMC_DISABLED,
|
CSMC_DISABLED,
|
||||||
CSMC_BOTH,
|
CSMC_BOTH,
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
#include "Enhancements/cosmetics/CosmeticsEditor.h"
|
#include "Enhancements/cosmetics/CosmeticsEditor.h"
|
||||||
#include "Enhancements/audio/AudioCollection.h"
|
#include "Enhancements/audio/AudioCollection.h"
|
||||||
#include "Enhancements/audio/AudioEditor.h"
|
#include "Enhancements/audio/AudioEditor.h"
|
||||||
|
#include "Enhancements/enhancementTypes.h"
|
||||||
#include "Enhancements/debugconsole.h"
|
#include "Enhancements/debugconsole.h"
|
||||||
#include "Enhancements/randomizer/randomizer.h"
|
#include "Enhancements/randomizer/randomizer.h"
|
||||||
#include "Enhancements/randomizer/randomizer_entrance_tracker.h"
|
#include "Enhancements/randomizer/randomizer_entrance_tracker.h"
|
||||||
@ -1031,10 +1032,10 @@ extern "C" uint32_t ResourceMgr_GetGameVersion(int index) {
|
|||||||
|
|
||||||
uint32_t IsSceneMasterQuest(s16 sceneNum) {
|
uint32_t IsSceneMasterQuest(s16 sceneNum) {
|
||||||
uint32_t value = 0;
|
uint32_t value = 0;
|
||||||
uint8_t mqMode = CVarGetInteger("gBetterDebugWarpScreenMQMode", 0);
|
uint8_t mqMode = CVarGetInteger("gBetterDebugWarpScreenMQMode", WARP_MODE_OVERRIDE_OFF);
|
||||||
if (mqMode == 1) { // non-mq wants to be mq
|
if (mqMode == WARP_MODE_OVERRIDE_MQ_AS_VANILLA) {
|
||||||
return 1;
|
return 1;
|
||||||
} else if (mqMode == 2) { // mq wants to be non-mq
|
} else if (mqMode == WARP_MODE_OVERRIDE_VANILLA_AS_MQ) {
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
if (OTRGlobals::Instance->HasMasterQuest()) {
|
if (OTRGlobals::Instance->HasMasterQuest()) {
|
||||||
|
@ -1937,14 +1937,18 @@ void Play_InitScene(PlayState* play, s32 spawn)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Play_SpawnScene(PlayState* play, s32 sceneNum, s32 spawn) {
|
void Play_SpawnScene(PlayState* play, s32 sceneNum, s32 spawn) {
|
||||||
|
uint8_t mqMode = CVarGetInteger("gBetterDebugWarpScreenMQMode", WARP_MODE_OVERRIDE_OFF);
|
||||||
|
int16_t mqModeScene = CVarGetInteger("gBetterDebugWarpScreenMQModeScene", -1);
|
||||||
|
if (mqMode != WARP_MODE_OVERRIDE_OFF && sceneNum != mqModeScene) {
|
||||||
|
CVarClear("gBetterDebugWarpScreenMQMode");
|
||||||
|
CVarClear("gBetterDebugWarpScreenMQModeScene");
|
||||||
|
}
|
||||||
|
|
||||||
OTRPlay_SpawnScene(play, sceneNum, spawn);
|
OTRPlay_SpawnScene(play, sceneNum, spawn);
|
||||||
|
|
||||||
if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_ENTRANCES)) {
|
if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_ENTRANCES)) {
|
||||||
Entrance_OverrideSpawnScene(sceneNum, spawn);
|
Entrance_OverrideSpawnScene(sceneNum, spawn);
|
||||||
}
|
}
|
||||||
|
|
||||||
CVarClear("gBetterDebugWarpScreenMQMode");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_800C016C(PlayState* play, Vec3f* src, Vec3f* dest) {
|
void func_800C016C(PlayState* play, Vec3f* src, Vec3f* dest) {
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#include "vt.h"
|
#include "vt.h"
|
||||||
#include "alloca.h"
|
#include "alloca.h"
|
||||||
|
|
||||||
|
#include "soh/Enhancements/enhancementTypes.h"
|
||||||
#include "soh/Enhancements/randomizer/randomizer_entrance.h"
|
#include "soh/Enhancements/randomizer/randomizer_entrance.h"
|
||||||
|
|
||||||
void Select_SwitchBetterWarpMode(SelectContext* this, u8 isBetterWarpMode);
|
void Select_SwitchBetterWarpMode(SelectContext* this, u8 isBetterWarpMode);
|
||||||
@ -52,11 +53,14 @@ void Select_LoadGame(SelectContext* this, s32 entranceIndex) {
|
|||||||
BetterSceneSelectEntrancePair entrancePair = this->betterScenes[this->currentScene].entrancePairs[this->pageDownIndex];
|
BetterSceneSelectEntrancePair entrancePair = this->betterScenes[this->currentScene].entrancePairs[this->pageDownIndex];
|
||||||
// Check to see if the scene/entrance we just picked can be MQ'd
|
// Check to see if the scene/entrance we just picked can be MQ'd
|
||||||
if (entrancePair.canBeMQ) {
|
if (entrancePair.canBeMQ) {
|
||||||
u8 isEntranceDefaultMQ = ResourceMgr_IsSceneMasterQuest(gEntranceTable[entrancePair.entranceIndex].scene);
|
s16 scene = gEntranceTable[entrancePair.entranceIndex].scene;
|
||||||
if (!isEntranceDefaultMQ && this->opt) {
|
u8 isEntranceDefaultMQ = ResourceMgr_IsSceneMasterQuest(scene);
|
||||||
CVarSetInteger("gBetterDebugWarpScreenMQMode", 1); // Force vanilla for default MQ scene
|
if (!isEntranceDefaultMQ && this->opt) { // Force vanilla for default MQ scene
|
||||||
} else if (isEntranceDefaultMQ && !this->opt) {
|
CVarSetInteger("gBetterDebugWarpScreenMQMode", WARP_MODE_OVERRIDE_MQ_AS_VANILLA);
|
||||||
CVarSetInteger("gBetterDebugWarpScreenMQMode", 2); // Force MQ for default vanilla scene
|
CVarSetInteger("gBetterDebugWarpScreenMQModeScene", scene);
|
||||||
|
} else if (isEntranceDefaultMQ && !this->opt) { // Force MQ for default vanilla scene
|
||||||
|
CVarSetInteger("gBetterDebugWarpScreenMQMode", WARP_MODE_OVERRIDE_VANILLA_AS_MQ);
|
||||||
|
CVarSetInteger("gBetterDebugWarpScreenMQModeScene", scene);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1633,5 +1637,6 @@ void Select_Init(GameState* thisx) {
|
|||||||
gSaveContext.dayTime = 0x8000;
|
gSaveContext.dayTime = 0x8000;
|
||||||
|
|
||||||
CVarClear("gBetterDebugWarpScreenMQMode");
|
CVarClear("gBetterDebugWarpScreenMQMode");
|
||||||
|
CVarClear("gBetterDebugWarpScreenMQModeScene");
|
||||||
Select_SwitchBetterWarpMode(this, CVarGetInteger("gBetterDebugWarpScreen", 0));
|
Select_SwitchBetterWarpMode(this, CVarGetInteger("gBetterDebugWarpScreen", 0));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user