This commit is contained in:
Eric Hoey 2025-08-13 16:34:12 -04:00 committed by GitHub
commit 55b92499d5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 3 deletions

View file

@ -1,4 +1,5 @@
#include <libultraship/bridge.h> #include <libultraship/bridge.h>
#include "soh/ResourceManagerHelpers.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#include "soh/ShipInit.hpp" #include "soh/ShipInit.hpp"
#include "global.h" #include "global.h"
@ -102,8 +103,17 @@ void CrawlSpeed_Register() {
COND_VB_SHOULD(VB_CRAWL_SPEED_INCREASE, shouldRegister, { COND_VB_SHOULD(VB_CRAWL_SPEED_INCREASE, shouldRegister, {
Player* player = GET_PLAYER(gPlayState); Player* player = GET_PLAYER(gPlayState);
bool isMQ = ResourceMgr_IsGameMasterQuest();
bool boulderExists = !Flags_GetSwitch(gPlayState, 5);
bool excludeSpiritMQBoulder =
(gPlayState->sceneNum == SCENE_SPIRIT_TEMPLE && player->actor.world.pos.z < -545.0f &&
player->actor.world.pos.z > -630.0f && isMQ && boulderExists);
if (excludeSpiritMQBoulder) {
*should = true;
} else {
IncreaseCrawlSpeed(player, gPlayState); IncreaseCrawlSpeed(player, gPlayState);
*should = false; *should = false;
}
}); });
} }

View file

@ -468,7 +468,7 @@ void SohMenu::AddMenuEnhancements() {
.Options(IntSliderOptions().Min(0).Max(5).DefaultValue(0).Format("+%d")); .Options(IntSliderOptions().Min(0).Max(5).DefaultValue(0).Format("+%d"));
AddWidget(path, "Crawl Speed %dx", WIDGET_CVAR_SLIDER_INT) AddWidget(path, "Crawl Speed %dx", WIDGET_CVAR_SLIDER_INT)
.CVar(CVAR_ENHANCEMENT("CrawlSpeed")) .CVar(CVAR_ENHANCEMENT("CrawlSpeed"))
.Options(IntSliderOptions().Min(1).Max(4).DefaultValue(1).Format("%dx")); .Options(IntSliderOptions().Min(1).Max(5).DefaultValue(1).Format("%dx"));
AddWidget(path, "Exclude Glitch-Aiding Crawlspaces", WIDGET_CVAR_CHECKBOX) AddWidget(path, "Exclude Glitch-Aiding Crawlspaces", WIDGET_CVAR_CHECKBOX)
.CVar(CVAR_ENHANCEMENT("GlitchAidingCrawlspaces")) .CVar(CVAR_ENHANCEMENT("GlitchAidingCrawlspaces"))
.PreFunc([](WidgetInfo& info) { info.isHidden = CVarGetInteger(CVAR_ENHANCEMENT("CrawlSpeed"), 0) == 1; }) .PreFunc([](WidgetInfo& info) { info.isHidden = CVarGetInteger(CVAR_ENHANCEMENT("CrawlSpeed"), 0) == 1; })