summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Van Caem <andrewwvc@gmail.com>2023-10-31 02:55:02 +1100
committerGitHub <noreply@github.com>2023-10-30 10:55:02 -0500
commitdab070a8a138e3fb0b04dbd3ff81a7f4b7794d9b (patch)
tree97dc601d5ac4544d00ee249e45f5be31937f44cd
parente4cfc8852d9e84fbfa29811896a0ea41c2cd21be (diff)
Added 'Fix enemies not spawning near water' checkbox to Fixes (#3179)
-rw-r--r--soh/soh/Enhancements/presets.h3
-rw-r--r--soh/soh/SohMenuBar.cpp3
-rw-r--r--soh/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c2
3 files changed, 7 insertions, 1 deletions
diff --git a/soh/soh/Enhancements/presets.h b/soh/soh/Enhancements/presets.h
index ddbee3871..b113c705a 100644
--- a/soh/soh/Enhancements/presets.h
+++ b/soh/soh/Enhancements/presets.h
@@ -216,6 +216,7 @@ const std::vector<const char*> enhancementsCvars = {
"gBowReticle",
"gFixTexturesOOB",
"gIvanCoopModeEnabled",
+ "gEnemySpawnsOverWaterboxes",
};
const std::vector<const char*> cheatCvars = {
@@ -523,6 +524,8 @@ const std::vector<PresetEntry> enhancedPresetEntries = {
PRESET_ENTRY_S32("gNaviTextFix", 1),
// Extend Silver Rupee Jingle
PRESET_ENTRY_S32("gSilverRupeeJingleExtend", 1),
+ // Fix enemies not spawning on ground over water
+ PRESET_ENTRY_S32("gEnemySpawnsOverWaterboxes", 1),
// Red Ganon blood
PRESET_ENTRY_S32("gRedGanonBlood", 1),
diff --git a/soh/soh/SohMenuBar.cpp b/soh/soh/SohMenuBar.cpp
index 0dd87bd82..2a52006a4 100644
--- a/soh/soh/SohMenuBar.cpp
+++ b/soh/soh/SohMenuBar.cpp
@@ -1042,6 +1042,9 @@ void DrawEnhancementsMenu() {
UIWidgets::PaddedEnhancementCheckbox("Fix Poacher's Saw Softlock", "gFixSawSoftlock", true, false, CVarGetInteger("gSkipText", 0),
"This is disabled because it is forced on when Skip Text is enabled.", UIWidgets::CheckboxGraphics::Checkmark);
UIWidgets::Tooltip("Prevents the Poacher's Saw softlock from mashing through the text, or with Skip Text enabled.");
+ UIWidgets::PaddedEnhancementCheckbox("Fix enemies not spawning near water", "gEnemySpawnsOverWaterboxes", true, false);
+ UIWidgets::Tooltip("Causes respawning enemies, like stalchildren, to appear on land near bodies of water. "
+ "Fixes an incorrect calculation that acted like water underneath ground was above it.");
UIWidgets::PaddedEnhancementCheckbox("Fix Bush Item Drops", "gBushDropFix", true, false);
UIWidgets::Tooltip("Fixes the bushes to drop items correctly rather than spawning undefined items.");
diff --git a/soh/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c b/soh/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c
index 9cbd8b8ca..2d05c116c 100644
--- a/soh/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c
+++ b/soh/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c
@@ -278,7 +278,7 @@ void EnEncount1_SpawnStalchildOrWolfos(EnEncount1* this, PlayState* play) {
break;
}
if ((player->actor.yDistToWater != BGCHECK_Y_MIN) &&
- (floorY < (player->actor.world.pos.y - player->actor.yDistToWater))) {
+ (floorY < (player->actor.world.pos.y + player->actor.yDistToWater*(CVarGetInteger("gEnemySpawnsOverWaterboxes", 0) ? 1 : -1)))) {
break;
}
spawnPos.y = floorY;