From d3bfc102fe5d8fafc66fb26c1aaba49273cfa50e Mon Sep 17 00:00:00 2001 From: aMannus Date: Tue, 6 Dec 2022 06:28:50 +0100 Subject: [PATCH] [Fix} Small Crowd Control fixes (#2061) --- soh/soh/Enhancements/crowd-control/CrowdControl.cpp | 10 +++++++++- soh/soh/GameMenuBar.cpp | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/soh/soh/Enhancements/crowd-control/CrowdControl.cpp b/soh/soh/Enhancements/crowd-control/CrowdControl.cpp index f00b25b1d..2cc35a9cd 100644 --- a/soh/soh/Enhancements/crowd-control/CrowdControl.cpp +++ b/soh/soh/Enhancements/crowd-control/CrowdControl.cpp @@ -458,7 +458,7 @@ CrowdControl::EffectResult CrowdControl::ExecuteEffect(std::string effectId, uin if (dryRun == 0) CMD_EXECUTE(fmt::format("defense_modifier {}", value)); return EffectResult::Success; } else if (effectId == EFFECT_DAMAGE) { - if ((gSaveContext.healthCapacity - 0x10) <= 0) { + if ((gSaveContext.health - (16 * value)) <= 0) { return EffectResult::Failure; } @@ -482,6 +482,14 @@ bool CrowdControl::SpawnEnemy(std::string effectId) { if (effectId == EFFECT_SPAWN_WALLMASTER) { enemyId = 17; } else if (effectId == EFFECT_SPAWN_ARWING) { + // Don't allow Arwings in certain areas because they cause issues. + // Locations: King dodongo room, Morpha room, Twinrova room, Ganondorf room, Fishing pond, Ganon's room + // TODO: Swap this to disabling the option in CC options menu instead. + if (gPlayState->sceneNum == SCENE_DDAN_BOSS || gPlayState->sceneNum == SCENE_MIZUSIN_BS || + gPlayState->sceneNum == SCENE_JYASINBOSS || gPlayState->sceneNum == SCENE_GANON_BOSS || + gPlayState->sceneNum == SCENE_TURIBORI || gPlayState->sceneNum == SCENE_GANON_DEMO) { + return 0; + } enemyId = 315; enemyParams = 1; posYOffset = 100; diff --git a/soh/soh/GameMenuBar.cpp b/soh/soh/GameMenuBar.cpp index f52c9bfee..9b6ecf3ce 100644 --- a/soh/soh/GameMenuBar.cpp +++ b/soh/soh/GameMenuBar.cpp @@ -1631,7 +1631,7 @@ namespace GameMenuBar { ImGui::PopStyleColor(1); #ifdef ENABLE_CROWD_CONTROL UIWidgets::PaddedEnhancementCheckbox("Crowd Control", "gCrowdControl", true, false); - UIWidgets::Tooltip("Requires a full SoH restart to take effect!\n\nEnables CrowdControl. Will attempt to connect to the local Crowd Control server."); + UIWidgets::Tooltip("Will attempt to connect to the Crowd Control server. Check out crowdcontrol.live for more information."); if (CVar_GetS32("gCrowdControl", 0)) { CrowdControl::Instance->Enable();