From 90d45d4397b638e68d55a56be48f1de097fed806 Mon Sep 17 00:00:00 2001 From: Garrett Cox Date: Mon, 12 Jun 2023 19:40:29 -0500 Subject: [PATCH] Rename gDirtPathFix to gZFightingMode (#2959) * Rename gDirtPathFix to gZFightingMode * Add config migration --- soh/soh/Enhancements/mods.cpp | 4 ++-- soh/soh/Enhancements/presets.h | 3 ++- soh/soh/config/ConfigUpdaters.cpp | 4 ++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/soh/soh/Enhancements/mods.cpp b/soh/soh/Enhancements/mods.cpp index b5bc3ec3e..c5903be36 100644 --- a/soh/soh/Enhancements/mods.cpp +++ b/soh/soh/Enhancements/mods.cpp @@ -537,10 +537,10 @@ void UpdateDirtPathFixState(int32_t sceneNum) { case SCENE_SPOT00: case SCENE_SPOT04: case SCENE_SPOT15: - CVarSetInteger("gDirtPathFix", CVarGetInteger("gSceneSpecificDirtPathFix", ZFIGHT_FIX_DISABLED)); + CVarSetInteger("gZFightingMode", CVarGetInteger("gSceneSpecificDirtPathFix", ZFIGHT_FIX_DISABLED)); return; default: - CVarClear("gDirtPathFix"); + CVarClear("gZFightingMode"); } } diff --git a/soh/soh/Enhancements/presets.h b/soh/soh/Enhancements/presets.h index a89074a7d..9227205c0 100644 --- a/soh/soh/Enhancements/presets.h +++ b/soh/soh/Enhancements/presets.h @@ -206,7 +206,8 @@ const std::vector enhancementsCvars = { "gDrawLineupTick", "gQuickBongoKill", "gFPSGauntlets", - "gDirtPathFix", + "gSceneSpecificDirtPathFix", + "gZFightingMode", "gAuthenticLogo", "gPauseLiveLinkRotationSpeed", "gBowReticle", diff --git a/soh/soh/config/ConfigUpdaters.cpp b/soh/soh/config/ConfigUpdaters.cpp index f7da1cbfc..a157ab9e7 100644 --- a/soh/soh/config/ConfigUpdaters.cpp +++ b/soh/soh/config/ConfigUpdaters.cpp @@ -49,5 +49,9 @@ namespace LUS { if (conf->GetString("Game.Patches Archive", "") == "") { conf->Erase("Game.Patches Archive"); } + if (CVarGetInteger("gDirtPathFix", 0) != 0) { + CVarSetInteger("gZFightingMode", CVarGetInteger("gDirtPathFix", 0)); + CVarClear("gDirtPathFix"); + } } } \ No newline at end of file