From ad30b56316a0bf8fbd45fad76d287f0540d420fe Mon Sep 17 00:00:00 2001 From: shadow578 <52449218+shadow578@users.noreply.github.com> Date: Wed, 3 Jun 2026 18:16:15 +0200 Subject: [PATCH 1/4] update SKD dependency to version 4.0.2 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 238318f..502b984 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ project(ChaosMod CXX) # Find latest version at https://github.com/OrfeasZ/ZHMModSDK/releases # Set ZHMMODSDK_DIR variable to a local directory to use a local copy of the ZHMModSDK. -set(ZHMMODSDK_VER "v4.0.0-rc.3") +set(ZHMMODSDK_VER "v4.0.2") include(cmake/setup-zhmmodsdk.cmake) # Set C++ standard to C++23. From 19a10ee7ce3c44e4d92693e55f07d52ead462c08 Mon Sep 17 00:00:00 2001 From: shadow578 <52449218+shadow578@users.noreply.github.com> Date: Wed, 3 Jun 2026 18:25:03 +0200 Subject: [PATCH 2/4] fix compile error due to undefined max macro --- src/Effects/Actors/ZNearbyActorSpeakEffect.cpp | 2 +- src/Helpers/EntityUtils.cpp | 5 ----- src/Helpers/ImGuiExtras.h | 2 +- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/Effects/Actors/ZNearbyActorSpeakEffect.cpp b/src/Effects/Actors/ZNearbyActorSpeakEffect.cpp index 63383c3..2e8fa7f 100644 --- a/src/Effects/Actors/ZNearbyActorSpeakEffect.cpp +++ b/src/Effects/Actors/ZNearbyActorSpeakEffect.cpp @@ -183,7 +183,7 @@ float32 ZNearbyActorSpeakEffect::GetRepetitionDelay() const const float32 s_fVariance = Math::GetRandomNumber(-m_fRepetitionDelayVariance, m_fRepetitionDelayVariance); const float32 s_fDelay = m_fRepetitionDelay + s_fVariance; - return max(s_fDelay, 0.0f); + return std::max(s_fDelay, 0.0f); } REGISTER_CHAOS_EFFECT_PARAM(curse, ZNearbyActorSpeakEffect, "curse", "Cussocalypse", diff --git a/src/Helpers/EntityUtils.cpp b/src/Helpers/EntityUtils.cpp index 9522fae..f9cfce0 100644 --- a/src/Helpers/EntityUtils.cpp +++ b/src/Helpers/EntityUtils.cpp @@ -11,11 +11,6 @@ #define TAG "[EntityUtils] " -// something defines a max macro, and it breaks std::numeric_limits::max() -#ifdef max -#undef max -#endif - std::vector Utils::ZEntityFinder::Find(const size_t p_nMaxResults) const { std::vector s_aFoundEntities; diff --git a/src/Helpers/ImGuiExtras.h b/src/Helpers/ImGuiExtras.h index c69b9aa..66f3ebb 100644 --- a/src/Helpers/ImGuiExtras.h +++ b/src/Helpers/ImGuiExtras.h @@ -43,7 +43,7 @@ namespace ImGuiEx const auto s_vTextSize = ImGui::CalcTextSize(p_sOverlayText); const auto s_fTextWidth = s_vTextSize.x + (p_fTextPadding * 2.0f); const auto s_fWindowWidth = ImGui::GetContentRegionAvail().x; - const auto s_fBarWidth = max(s_fWindowWidth, s_fTextWidth); + const auto s_fBarWidth = std::max(s_fWindowWidth, s_fTextWidth); // Draw progress bar without overlay text ImGui::ProgressBar(p_fFraction, ImVec2(s_fBarWidth, 0.0f), ""); From 639d419f5a81467b6be0a750f0e96cc0f16e11d0 Mon Sep 17 00:00:00 2001 From: shadow578 <52449218+shadow578@users.noreply.github.com> Date: Wed, 3 Jun 2026 18:25:13 +0200 Subject: [PATCH 3/4] test mode: skip disabled effects --- src/ChaosModDevTools.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ChaosModDevTools.cpp b/src/ChaosModDevTools.cpp index 34709a8..6fb319c 100644 --- a/src/ChaosModDevTools.cpp +++ b/src/ChaosModDevTools.cpp @@ -31,15 +31,16 @@ void ChaosMod::UpdateTestMode(const float32 p_fDeltaTime) } auto s_pEffect = s_aEffects[m_nTestmodeEffectIndex]; - if (s_pEffect) + if (s_pEffect && s_pEffect->IsEnabled()) { Logger::Info(TAG "[TM] Activating effect '{}'", s_pEffect->GetName()); m_pEffectForDebug = s_pEffect; ActivateEffect(s_pEffect, m_fTestmodeInterval - 1.0f); - } + m_fTestmodeTimeToNextEffect = m_fTestmodeInterval; + } + m_nTestmodeEffectIndex = (m_nTestmodeEffectIndex + 1) % s_aEffects.size(); - m_fTestmodeTimeToNextEffect = m_fTestmodeInterval; } } From 9d6e3adf677e3ec0dfa53623058456ab9a838ed2 Mon Sep 17 00:00:00 2001 From: shadow578 <52449218+shadow578@users.noreply.github.com> Date: Wed, 3 Jun 2026 19:01:15 +0200 Subject: [PATCH 4/4] autoformat --- src/ChaosModDevTools.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ChaosModDevTools.cpp b/src/ChaosModDevTools.cpp index 6fb319c..9c7b5ac 100644 --- a/src/ChaosModDevTools.cpp +++ b/src/ChaosModDevTools.cpp @@ -39,7 +39,7 @@ void ChaosMod::UpdateTestMode(const float32 p_fDeltaTime) m_fTestmodeTimeToNextEffect = m_fTestmodeInterval; } - + m_nTestmodeEffectIndex = (m_nTestmodeEffectIndex + 1) % s_aEffects.size(); } }