From 97a11907135ae90e0cd6a6a1861bc6cf5a734320 Mon Sep 17 00:00:00 2001 From: Pheenoh Date: Fri, 8 May 2026 08:59:13 -0600 Subject: [PATCH 1/3] set max chain links to 600 --- src/d/actor/d_a_alink_hook.inc | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/src/d/actor/d_a_alink_hook.inc b/src/d/actor/d_a_alink_hook.inc index 73049af08b..b45adddf9a 100644 --- a/src/d/actor/d_a_alink_hook.inc +++ b/src/d/actor/d_a_alink_hook.inc @@ -17,11 +17,11 @@ enum { HS_MODE_RETURN_e = 6, }; -void daAlink_c::hsChainShape_c::draw() { - if (dusk::getSettings().game.superClawshot) { - return; - } +#if TARGET_PC +static const int HS_CHAIN_MAX_LINKS = 600; +#endif +void daAlink_c::hsChainShape_c::draw() { static const int dummy = 0; daAlink_c* alink = (daAlink_c*)getUserArea(); @@ -165,7 +165,14 @@ void daAlink_c::hsChainShape_c::draw() { } (void)0; - while (maxDistanceF > var_f30) { +#if TARGET_PC + int chainLinks = 0; +#endif + while (maxDistanceF > var_f30 +#if TARGET_PC + && chainLinks < HS_CHAIN_MAX_LINKS +#endif + ) { temp_f27 = var_f28 * cM_fsin(sp34 * var_f30); s16 spC = cM_atan2s(temp_f27 - var_f26, 5.0f); sp64.x = sp6C.x + spC; @@ -187,6 +194,9 @@ void daAlink_c::hsChainShape_c::draw() { var_f26 = temp_f27; var_f30 += fabsf(cM_scos(spC)) * 5.0f; +#if TARGET_PC + chainLinks++; +#endif } } @@ -202,7 +212,14 @@ void daAlink_c::hsChainShape_c::draw() { sp98 = subChainTopPos; sp6C.set(maxDistance.atan2sY_XZ(), maxDistance.atan2sX_Z(), 0); - while (maxDistanceF > var_f30) { +#if TARGET_PC + int subChainLinks = 0; +#endif + while (maxDistanceF > var_f30 +#if TARGET_PC + && subChainLinks < HS_CHAIN_MAX_LINKS +#endif + ) { mDoMtx_stack_c::copy(j3dSys.getViewMtx()); mDoMtx_stack_c::transM(sp98); mDoMtx_stack_c::ZXYrotM(sp6C); @@ -215,6 +232,9 @@ void daAlink_c::hsChainShape_c::draw() { sp98 += maxDistance * 5.0f; ANGLE_ADD_2(sp6C.z, 0x3000); var_f30 += 5.0f; +#if TARGET_PC + subChainLinks++; +#endif } } } From 6fd3762ffcd624bad5cd2b22ba501c9ad52a827e Mon Sep 17 00:00:00 2001 From: MelonSpeedruns Date: Fri, 8 May 2026 12:06:38 -0400 Subject: [PATCH 2/3] optimized code --- src/d/actor/d_a_alink_hook.inc | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/d/actor/d_a_alink_hook.inc b/src/d/actor/d_a_alink_hook.inc index b45adddf9a..c960d37a7b 100644 --- a/src/d/actor/d_a_alink_hook.inc +++ b/src/d/actor/d_a_alink_hook.inc @@ -168,11 +168,8 @@ void daAlink_c::hsChainShape_c::draw() { #if TARGET_PC int chainLinks = 0; #endif - while (maxDistanceF > var_f30 -#if TARGET_PC - && chainLinks < HS_CHAIN_MAX_LINKS -#endif - ) { + + while (maxDistanceF > var_f30 IF_DUSK(&&chainLinks < HS_CHAIN_MAX_LINKS)) { temp_f27 = var_f28 * cM_fsin(sp34 * var_f30); s16 spC = cM_atan2s(temp_f27 - var_f26, 5.0f); sp64.x = sp6C.x + spC; @@ -194,6 +191,7 @@ void daAlink_c::hsChainShape_c::draw() { var_f26 = temp_f27; var_f30 += fabsf(cM_scos(spC)) * 5.0f; + #if TARGET_PC chainLinks++; #endif @@ -215,11 +213,8 @@ void daAlink_c::hsChainShape_c::draw() { #if TARGET_PC int subChainLinks = 0; #endif - while (maxDistanceF > var_f30 -#if TARGET_PC - && subChainLinks < HS_CHAIN_MAX_LINKS -#endif - ) { + + while (maxDistanceF > var_f30 IF_DUSK(&&subChainLinks < HS_CHAIN_MAX_LINKS)) { mDoMtx_stack_c::copy(j3dSys.getViewMtx()); mDoMtx_stack_c::transM(sp98); mDoMtx_stack_c::ZXYrotM(sp6C); From 3934e09c8fca590a02f8075b47b315c9a2efb662 Mon Sep 17 00:00:00 2001 From: MelonSpeedruns Date: Fri, 8 May 2026 12:07:00 -0400 Subject: [PATCH 3/3] remove mention of chains not rendering --- src/dusk/ui/settings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dusk/ui/settings.cpp b/src/dusk/ui/settings.cpp index 7158a2460a..e41dbbe46a 100644 --- a/src/dusk/ui/settings.cpp +++ b/src/dusk/ui/settings.cpp @@ -871,7 +871,7 @@ SettingsWindow::SettingsWindow(bool prelaunch) : mPrelaunch(prelaunch) { addCheat( "Moon Jump (R+A)", getSettings().game.moonJump, "Hold R and A to rise into the air."); addCheat("Super Clawshot", getSettings().game.superClawshot, - "Extends Clawshot behavior beyond the normal game rules.
This will disable chains from rendering to prevent crashes."); + "Extends Clawshot behavior beyond the normal game rules."); addCheat("Always Greatspin", getSettings().game.alwaysGreatspin, "Allows the Great Spin attack without requiring full health."); addCheat("Fast Iron Boots", getSettings().game.enableFastIronBoots,