Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 3 additions & 2 deletions src/ChaosModDevTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Effects/Actors/ZNearbyActorSpeakEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ float32 ZNearbyActorSpeakEffect::GetRepetitionDelay() const

const float32 s_fVariance = Math::GetRandomNumber<float32>(-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",
Expand Down
5 changes: 0 additions & 5 deletions src/Helpers/EntityUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<ZEntityRef> Utils::ZEntityFinder::Find(const size_t p_nMaxResults) const
Comment thread
shadow578 marked this conversation as resolved.
{
std::vector<ZEntityRef> s_aFoundEntities;
Expand Down
2 changes: 1 addition & 1 deletion src/Helpers/ImGuiExtras.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Comment thread
shadow578 marked this conversation as resolved.

// Draw progress bar without overlay text
ImGui::ProgressBar(p_fFraction, ImVec2(s_fBarWidth, 0.0f), "");
Expand Down
Loading