From 5923bb36e1168cbb67c99a319dd0da91d3d8567e Mon Sep 17 00:00:00 2001 From: rei-2 <174158077+rei-2@users.noreply.github.com> Date: Mon, 18 Nov 2024 21:36:21 -0500 Subject: [PATCH] fix some mutex crash --- Amalgam/Amalgam.vcxproj | 32 +++++++++---------- Amalgam/src/Features/CritHack/CritHack.cpp | 10 +++--- Amalgam/src/Features/ImGui/Menu/Menu.cpp | 1 - ...eamNetworkingUtils_GetPingToDataCenter.cpp | 2 +- 4 files changed, 22 insertions(+), 23 deletions(-) diff --git a/Amalgam/Amalgam.vcxproj b/Amalgam/Amalgam.vcxproj index 158952a2..d43b9dc4 100644 --- a/Amalgam/Amalgam.vcxproj +++ b/Amalgam/Amalgam.vcxproj @@ -376,7 +376,7 @@ Level3 false - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR;%(PreprocessorDefinitions) true stdcpp20 Default @@ -404,7 +404,7 @@ Level3 false - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR;IMGUI_ENABLE_FREETYPE;AMALGAM_CUSTOM_FONTS;%(PreprocessorDefinitions) true stdcpp20 Default @@ -433,7 +433,7 @@ Level3 false - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR;%(PreprocessorDefinitions) true stdcpp20 Default @@ -462,7 +462,7 @@ Level3 false - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR;IMGUI_ENABLE_FREETYPE;AMALGAM_CUSTOM_FONTS;%(PreprocessorDefinitions) true stdcpp20 Default @@ -493,7 +493,7 @@ true true false - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR;%(PreprocessorDefinitions) true stdcpp20 true @@ -519,7 +519,7 @@ true true false - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR;IMGUI_ENABLE_FREETYPE;AMALGAM_CUSTOM_FONTS;%(PreprocessorDefinitions) true stdcpp20 true @@ -546,7 +546,7 @@ true true false - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR;%(PreprocessorDefinitions) true stdcpp20 true @@ -573,7 +573,7 @@ true true false - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR;IMGUI_ENABLE_FREETYPE;AMALGAM_CUSTOM_FONTS;%(PreprocessorDefinitions) true stdcpp20 true @@ -598,7 +598,7 @@ Level3 false - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR;%(PreprocessorDefinitions) true stdcpp20 true @@ -627,7 +627,7 @@ Level3 false - WIN32;_DEBUG;_CONSOLE;IMGUI_ENABLE_FREETYPE;AMALGAM_CUSTOM_FONTS;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR;IMGUI_ENABLE_FREETYPE;AMALGAM_CUSTOM_FONTS;%(PreprocessorDefinitions) true stdcpp20 true @@ -656,7 +656,7 @@ Level3 false - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR;%(PreprocessorDefinitions) true stdcpp20 true @@ -685,7 +685,7 @@ Level3 false - WIN32;_DEBUG;_CONSOLE;IMGUI_ENABLE_FREETYPE;AMALGAM_CUSTOM_FONTS;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR;IMGUI_ENABLE_FREETYPE;AMALGAM_CUSTOM_FONTS;%(PreprocessorDefinitions) true stdcpp20 true @@ -716,7 +716,7 @@ true true false - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR;%(PreprocessorDefinitions) true stdcpp20 true @@ -743,7 +743,7 @@ true true false - WIN32;NDEBUG;_CONSOLE;IMGUI_ENABLE_FREETYPE;AMALGAM_CUSTOM_FONTS;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR;IMGUI_ENABLE_FREETYPE;AMALGAM_CUSTOM_FONTS;%(PreprocessorDefinitions) true stdcpp20 true @@ -770,7 +770,7 @@ true true false - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR;%(PreprocessorDefinitions) true stdcpp20 true @@ -797,7 +797,7 @@ true true false - WIN32;NDEBUG;_CONSOLE;IMGUI_ENABLE_FREETYPE;AMALGAM_CUSTOM_FONTS;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR;IMGUI_ENABLE_FREETYPE;AMALGAM_CUSTOM_FONTS;%(PreprocessorDefinitions) true stdcpp20 true diff --git a/Amalgam/src/Features/CritHack/CritHack.cpp b/Amalgam/src/Features/CritHack/CritHack.cpp index f5858151..88e878ed 100644 --- a/Amalgam/src/Features/CritHack/CritHack.cpp +++ b/Amalgam/src/Features/CritHack/CritHack.cpp @@ -477,10 +477,10 @@ void CCritHack::Draw(CTFPlayer* pLocal) if (WeaponCanCrit(pWeapon)) { - const auto iSlot = pWeapon->GetSlot(); + auto iSlot = pWeapon->GetSlot(); auto& tStorage = m_mStorage[iSlot]; - const auto bRapidFire = pWeapon->IsRapidFire(); - const float flTickBase = TICKS_TO_TIME(pLocal->m_nTickBase()); + auto bRapidFire = pWeapon->IsRapidFire(); + float flTickBase = TICKS_TO_TIME(pLocal->m_nTickBase()); if (tStorage.m_flDamage > 0) { @@ -488,7 +488,7 @@ void CCritHack::Draw(CTFPlayer* pLocal) H::Draw.StringOutlined(fFont, x, y, { 100, 255, 255, 255 }, { 0, 0, 0, 255 }, align, "Crit Boosted"); else if (pWeapon->m_flCritTime() > flTickBase) { - const float flTime = pWeapon->m_flCritTime() - flTickBase; + float flTime = pWeapon->m_flCritTime() - flTickBase; H::Draw.StringOutlined(fFont, x, y, { 100, 255, 255, 255 }, { 0, 0, 0, 255 }, align, std::format("Streaming crits {:.1f}s", flTime).c_str()); } else if (!m_bCritBanned) @@ -497,7 +497,7 @@ void CCritHack::Draw(CTFPlayer* pLocal) { if (bRapidFire && flTickBase < pWeapon->m_flLastRapidFireCritCheckTime() + 1.f) { - const float flTime = pWeapon->m_flLastRapidFireCritCheckTime() + 1.f - flTickBase; + float flTime = pWeapon->m_flLastRapidFireCritCheckTime() + 1.f - flTickBase; H::Draw.StringOutlined(fFont, x, y, Vars::Menu::Theme::Active.Value, Vars::Menu::Theme::Background.Value, align, std::format("Wait {:.1f}s", flTime).c_str()); } else diff --git a/Amalgam/src/Features/ImGui/Menu/Menu.cpp b/Amalgam/src/Features/ImGui/Menu/Menu.cpp index 6d9f47fa..79111a7c 100644 --- a/Amalgam/src/Features/ImGui/Menu/Menu.cpp +++ b/Amalgam/src/Features/ImGui/Menu/Menu.cpp @@ -10,7 +10,6 @@ #include "../../Resolver/Resolver.h" #include "../../Misc/Misc.h" #include "../../Records/Records.h" -#include /* The main menu */ void CMenu::DrawMenu() diff --git a/Amalgam/src/Hooks/ISteamNetworkingUtils_GetPingToDataCenter.cpp b/Amalgam/src/Hooks/ISteamNetworkingUtils_GetPingToDataCenter.cpp index 796fceff..8cd738b8 100644 --- a/Amalgam/src/Hooks/ISteamNetworkingUtils_GetPingToDataCenter.cpp +++ b/Amalgam/src/Hooks/ISteamNetworkingUtils_GetPingToDataCenter.cpp @@ -62,7 +62,7 @@ MAKE_HOOK(ISteamNetworkingUtils_GetPingToDataCenter, U::Memory.GetVFunc(I::Steam char popIDName[5]; POPID_ToString(popID, popIDName); if (auto uDatacenter = GetDatacenter(FNV1A::Hash32(popIDName))) - return Vars::Misc::Queueing::ForceRegions.Value & uDatacenter ? 1 : 999999; + return Vars::Misc::Queueing::ForceRegions.Value & uDatacenter ? 1 : 1000; return iReturn; }