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. diff --git a/src/ChaosModDevTools.cpp b/src/ChaosModDevTools.cpp index 34709a8..9c7b5ac 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; } } 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), "");