From 4839e575b184f214f6a893ce2f460af8c5585c2f Mon Sep 17 00:00:00 2001 From: Garrett Cox Date: Wed, 7 Jan 2026 23:53:36 -0600 Subject: [PATCH] Add toggle for Link's sword trail (#6112) --- soh/soh/SohGui/SohMenuEnhancements.cpp | 5 +++++ soh/src/code/z_player_lib.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/soh/soh/SohGui/SohMenuEnhancements.cpp b/soh/soh/SohGui/SohMenuEnhancements.cpp index 30cf7d549..f49e12171 100644 --- a/soh/soh/SohGui/SohMenuEnhancements.cpp +++ b/soh/soh/SohGui/SohMenuEnhancements.cpp @@ -545,6 +545,11 @@ void SohMenu::AddMenuEnhancements() { .Options(CheckboxOptions().Tooltip( "Disables Grottos rotating with the Camera. To be used in conjuction with mods that want to " "replace grottos with 3D objects.")); + AddWidget(path, "Disable Link's Sword Trail", WIDGET_CVAR_CHECKBOX) + .CVar(CVAR_ENHANCEMENT("DisableLinkSwordTrail")) + .RaceDisable(false) + .Options(CheckboxOptions().Tooltip("Disables the sword trail effect when swinging Link's sword. Useful when " + "using mods that replace Link's sword model.")); AddWidget(path, "Disable 2D Pre-Rendered Scenes", WIDGET_CVAR_CHECKBOX) .CVar(CVAR_ENHANCEMENT("3DSceneRender")) .RaceDisable(false) diff --git a/soh/src/code/z_player_lib.c b/soh/src/code/z_player_lib.c index 0502559f0..95898367f 100644 --- a/soh/src/code/z_player_lib.c +++ b/soh/src/code/z_player_lib.c @@ -1564,7 +1564,8 @@ void func_800906D4(PlayState* play, Player* this, Vec3f* newTipPos) { Matrix_MultVec3f(&D_801260A4[2], &newBasePos[2]); if (func_80090480(play, NULL, &this->meleeWeaponInfo[0], &newTipPos[0], &newBasePos[0]) && - !(this->stateFlags1 & PLAYER_STATE1_SHIELDING)) { + !(this->stateFlags1 & PLAYER_STATE1_SHIELDING) && + !CVarGetInteger(CVAR_ENHANCEMENT("DisableLinkSwordTrail"), 0)) { EffectBlure_AddVertex(Effect_GetByIndex(this->meleeWeaponEffectIndex), &this->meleeWeaponInfo[0].tip, &this->meleeWeaponInfo[0].base); }