From 22a61f386338e0d97fd8ba268d0ea82f436ffe4b Mon Sep 17 00:00:00 2001 From: rei-2 <174158077+rei-2@users.noreply.github.com> Date: Sun, 30 Mar 2025 14:49:49 -0400 Subject: [PATCH] misc changes and fixes --- Amalgam/Amalgam.vcxproj | 1 + Amalgam/Amalgam.vcxproj.filters | 1 + .../AimbotProjectile/AimbotProjectile.cpp | 238 +++++++++---- .../AimbotProjectile/AimbotProjectile.h | 2 +- Amalgam/src/Features/Binds/Binds.cpp | 2 +- Amalgam/src/Features/Configs/Configs.cpp | 2 +- Amalgam/src/Features/CritHack/CritHack.cpp | 25 +- Amalgam/src/Features/CritHack/CritHack.h | 2 +- .../Fonts/MaterialDesign/IconDefinitions.h | 9 +- Amalgam/src/Features/ImGui/Menu/Components.h | 36 +- Amalgam/src/Features/ImGui/Menu/Menu.cpp | 125 +++++-- Amalgam/src/Features/ImGui/Render.cpp | 13 +- Amalgam/src/Features/ImGui/Render.h | 1 - Amalgam/src/Features/Misc/Misc.cpp | 19 +- Amalgam/src/Features/Visuals/Chams/Chams.cpp | 14 +- Amalgam/src/Features/Visuals/Glow/Glow.cpp | 4 +- .../Features/Visuals/Materials/Materials.cpp | 51 +-- .../Features/Visuals/Materials/Materials.h | 8 +- .../Visuals/Notifications/Notifications.cpp | 9 +- .../Visuals/SpectatorList/SpectatorList.cpp | 5 +- Amalgam/src/Features/Visuals/Visuals.cpp | 46 +-- ...chievementMgr_CheckAchievementsEnabled.cpp | 2 +- .../CAttributeManager_AttribHookValue.cpp | 2 +- .../src/Hooks/CBaseAnimating_Interpolate.cpp | 2 +- ...eAnimating_MaintainSequenceTransitions.cpp | 2 +- .../src/Hooks/CBaseAnimating_SetSequence.cpp | 2 +- .../src/Hooks/CBaseAnimating_SetupBones.cpp | 2 +- ...aseAnimating_UpdateClientSideAnimation.cpp | 2 +- .../CBaseEntity_BaseInterpolatePart1.cpp | 2 +- .../Hooks/CBaseEntity_EstimateAbsVelocity.cpp | 2 +- Amalgam/src/Hooks/CBaseEntity_FireBullets.cpp | 2 +- .../src/Hooks/CBaseEntity_ResetLatched.cpp | 2 +- .../src/Hooks/CBaseEntity_SetAbsVelocity.cpp | 2 +- .../Hooks/CBaseEntity_WorldSpaceCenter.cpp | 2 +- ...CBaseHudChatLine_InsertAndColorizeText.cpp | 2 +- .../src/Hooks/CBasePlayer_CalcPlayerView.cpp | 2 +- .../Hooks/CBasePlayer_CalcViewModelView.cpp | 4 +- .../src/Hooks/CBasePlayer_ItemPostFrame.cpp | 2 +- .../CBaseViewModel_ShouldFlipViewModel.cpp | 2 +- .../Hooks/CClientModeShared_CreateMove.cpp | 2 +- ...entModeShared_DoPostScreenSpaceEffects.cpp | 2 +- .../Hooks/CClientModeShared_OverrideView.cpp | 2 +- .../CClientModeShared_ShouldDrawViewModel.cpp | 2 +- .../CClientState_GetClientInterpAmount.cpp | 2 +- .../Hooks/CClientState_ProcessFixAngle.cpp | 2 +- .../Hooks/CHudCrosshair_GetDrawPosition.cpp | 2 +- .../CInventoryManager_ShowItemsPickedUp.cpp | 2 +- .../Hooks/CL_CheckForPureServerWhitelist.cpp | 2 +- Amalgam/src/Hooks/CL_Move.cpp | 2 +- .../src/Hooks/CL_ProcessPacketEntities.cpp | 2 +- Amalgam/src/Hooks/CL_ReadPackets.cpp | 2 +- .../Hooks/CMatchInviteNotification_OnTick.cpp | 2 +- Amalgam/src/Hooks/CMaterial_Uncache.cpp | 2 +- .../src/Hooks/CNetChannel_SendDatagram.cpp | 2 +- Amalgam/src/Hooks/CNetChannel_SendNetMsg.cpp | 2 +- Amalgam/src/Hooks/COPRenderSprites_Render.cpp | 6 +- .../src/Hooks/CParticleProperty_Create.cpp | 4 +- .../Hooks/CPlayerResource_GetPlayerName.cpp | 2 +- .../src/Hooks/CPrediction_RunSimulation.cpp | 2 +- .../Hooks/CRendering3dView_EnableWorldFog.cpp | 2 +- .../Hooks/CSkyboxView_Enable3dSkyboxFog.cpp | 2 +- .../CSniperDot_GetRenderingPositions.cpp | 6 +- .../Hooks/CSoundEmitterSystem_EmitSound.cpp | 6 +- .../CStaticPropMgr_ComputePropOpacity.cpp | 2 +- .../Hooks/CStaticPropMgr_DrawStaticProps.cpp | 2 +- .../CStudioRender_DrawModelStaticProp.cpp | 2 +- .../CStudioRender_SetAlphaModulation.cpp | 2 +- .../CStudioRender_SetColorModulation.cpp | 2 +- .../src/Hooks/CTFBadgePanel_SetupBadge.cpp | 2 +- ...entScoreBoardDialog_UpdatePlayerAvatar.cpp | 10 +- .../CTFGCClientSystem_UpdateAssignedLobby.cpp | 2 +- .../CTFHudDeathNotice_AddAdditionalMsg.cpp | 4 +- Amalgam/src/Hooks/CTFInput_ApplyMouse.cpp | 4 +- .../CTFPlayerInventory_GetMaxItemCount.cpp | 2 +- Amalgam/src/Hooks/CTFPlayerPanel_GetTeam.cpp | 6 +- Amalgam/src/Hooks/CTFPlayerShared_InCond.cpp | 2 +- .../CTFPlayerShared_IsPlayerDominated.cpp | 2 +- Amalgam/src/Hooks/CTFPlayer_AvoidPlayers.cpp | 2 +- .../src/Hooks/CTFPlayer_BRenderAsZombie.cpp | 2 +- .../Hooks/CTFPlayer_BuildTransformations.cpp | 2 +- .../src/Hooks/CTFPlayer_DoAnimationEvent.cpp | 2 +- Amalgam/src/Hooks/CTFPlayer_IsPlayerClass.cpp | 2 +- Amalgam/src/Hooks/CTFPlayer_ShouldDraw.cpp | 6 +- .../src/Hooks/CTFPlayer_UpdateStepSound.cpp | 2 +- .../src/Hooks/CTFRagdoll_CreateTFRagdoll.cpp | 2 +- .../CTFWeaponBase_CalcIsAttackCritical.cpp | 2 +- .../src/Hooks/CTFWeaponBase_GetShootSound.cpp | 2 +- .../src/Hooks/CThirdPersonManager_Update.cpp | 2 +- .../CViewRender_DrawUnderwaterOverlay.cpp | 2 +- Amalgam/src/Hooks/CViewRender_LevelInit.cpp | 2 +- .../CViewRender_PerformScreenOverlay.cpp | 2 +- Amalgam/src/Hooks/CViewRender_RenderView.cpp | 2 +- Amalgam/src/Hooks/Cbuf_ExecuteCommand.cpp | 101 +++--- ...entModeTFNormal_BIsFriendOrPartyMember.cpp | 2 +- ...ntModeTFNormal_UpdateSteamRichPresence.cpp | 2 +- Amalgam/src/Hooks/DSP_Process.cpp | 2 +- Amalgam/src/Hooks/DoEnginePostProcessing.cpp | 2 +- Amalgam/src/Hooks/FX_FireBullets.cpp | 4 +- .../Hooks/GenerateEquipRegionConflictMask.cpp | 6 +- Amalgam/src/Hooks/GetClientInterpAmount.cpp | 2 +- Amalgam/src/Hooks/HostState_Shutdown.cpp | 4 +- .../IBaseClientDLL_DispatchUserMessage.cpp | 2 +- .../Hooks/IBaseClientDLL_FrameStageNotify.cpp | 2 +- .../Hooks/IBaseClientDLL_LevelShutdown.cpp | 2 +- .../src/Hooks/IEngineTrace_SetTraceEntity.cpp | 143 ++++++++ Amalgam/src/Hooks/IEngineTrace_TraceRay.cpp | 2 +- Amalgam/src/Hooks/IEngineVGui_Paint.cpp | 12 +- Amalgam/src/Hooks/IInput_GetUserCmd.cpp | 2 +- Amalgam/src/Hooks/IPanel_PaintTraverse.cpp | 2 +- .../ISteamFriends_GetFriendPersonaName.cpp | 2 +- ...eamNetworkingUtils_GetPingToDataCenter.cpp | 4 +- .../IVEngineClient_ClientCmd_Unrestricted.cpp | 2 +- .../Hooks/IVModelRender_DrawModelExecute.cpp | 6 +- .../IVModelRender_ForcedMaterialOverride.cpp | 2 +- Amalgam/src/Hooks/KeyValues_SetInt.cpp | 2 +- Amalgam/src/Hooks/NotificationQueue_Add.cpp | 2 +- Amalgam/src/Hooks/R_DrawSkyBox.cpp | 2 +- .../src/Hooks/RecvProxy_SimulationTime.cpp | 2 +- Amalgam/src/Hooks/TF_IsHolidayActive.cpp | 2 +- .../src/Hooks/VGuiMenuBuilder_AddMenuItem.cpp | 6 +- Amalgam/src/Hooks/bf_read_ReadString.cpp | 2 +- Amalgam/src/SDK/Definitions/Definitions.h | 9 +- .../src/SDK/Definitions/Main/CBaseHandle.h | 4 +- Amalgam/src/SDK/Definitions/Misc/BSPFlags.h | 1 + Amalgam/src/SDK/Definitions/Types.h | 332 +++++++++++------- .../SDK/Helpers/TraceFilters/TraceFilters.cpp | 7 +- Amalgam/src/SDK/SDK.cpp | 16 +- Amalgam/src/SDK/Vars.h | 142 ++++---- 128 files changed, 1024 insertions(+), 604 deletions(-) create mode 100644 Amalgam/src/Hooks/IEngineTrace_SetTraceEntity.cpp diff --git a/Amalgam/Amalgam.vcxproj b/Amalgam/Amalgam.vcxproj index c4def027..73195287 100644 --- a/Amalgam/Amalgam.vcxproj +++ b/Amalgam/Amalgam.vcxproj @@ -921,6 +921,7 @@ + diff --git a/Amalgam/Amalgam.vcxproj.filters b/Amalgam/Amalgam.vcxproj.filters index d465d103..d905821e 100644 --- a/Amalgam/Amalgam.vcxproj.filters +++ b/Amalgam/Amalgam.vcxproj.filters @@ -191,6 +191,7 @@ + diff --git a/Amalgam/src/Features/Aimbot/AimbotProjectile/AimbotProjectile.cpp b/Amalgam/src/Features/Aimbot/AimbotProjectile/AimbotProjectile.cpp index 80215d66..b9f51950 100644 --- a/Amalgam/src/Features/Aimbot/AimbotProjectile/AimbotProjectile.cpp +++ b/Amalgam/src/Features/Aimbot/AimbotProjectile/AimbotProjectile.cpp @@ -301,14 +301,19 @@ static inline std::vector> ComputeSphere(float flRadius, in std::vector> vPoints; vPoints.reserve(iSamples); + float flRotateX = Vars::Aimbot::Projectile::SplashRotateX.Value < 0.f ? SDK::StdRandomFloat(0.f, 360.f) : Vars::Aimbot::Projectile::SplashRotateX.Value; + float flRotateY = Vars::Aimbot::Projectile::SplashRotateY.Value < 0.f ? SDK::StdRandomFloat(0.f, 360.f) : Vars::Aimbot::Projectile::SplashRotateY.Value; + int iPointType = Vars::Aimbot::Projectile::SplashGrates.Value ? PointTypeEnum::Regular | PointTypeEnum::Obscured : PointTypeEnum::Regular; - float flRotate = Vars::Aimbot::Projectile::SplashRotate.Value * PI / 180.f; + if (Vars::Aimbot::Projectile::RocketSplashMode.Value == Vars::Aimbot::Projectile::RocketSplashModeEnum::SpecialHeavy) + iPointType |= PointTypeEnum::Multi1 | PointTypeEnum::Multi2; for (int n = 0; n < iSamples; n++) { float flA = acosf(1.f - 2.f * n / iSamples); - float flB = PI * (3.f - sqrtf(5.f)) * n + flRotate; + float flB = PI * (3.f - sqrtf(5.f)) * n; Vec3 vPoint = Vec3(sinf(flA) * cosf(flB), sinf(flA) * sinf(flB), -cosf(flA)); + vPoint = Math::RotatePoint(vPoint, {}, { flRotateX, flRotateY }); if (flNthroot != 1.f) { vPoint.x = powf(fabsf(vPoint.x), 1 / flNthroot) * sign(vPoint.x); @@ -332,16 +337,24 @@ std::vector CAimbotProjectile::GetSplashPoints(Target_t& tTarget, std:: Vec3 vTargetEye = tTarget.m_vPos + tInfo.m_vTargetEye; #if !defined(SPLASH_DEBUG1) && !defined(SPLASH_DEBUG2) - auto checkPoint = [&](CGameTrace& trace, bool& bErase, bool& bNormal) + auto checkPoint = [&](CGameTrace& trace, bool* pErase = nullptr, bool* pNormal = nullptr) #else - auto checkPoint = [&](CGameTrace& trace, bool& bErase, bool& bNormal, Vec3* pFrom = nullptr) + auto checkPoint = [&](CGameTrace& trace, bool* pErase = nullptr, bool* pNormal = nullptr, bool bDebug = false) #endif - { - bErase = trace.fraction == 1.f || !trace.m_pEnt || !trace.m_pEnt->GetAbsVelocity().IsZero() || trace.surface.flags & 0x0004 /*SURF_SKY*/; + { + bool bErase = false, bNormal = false; + + bErase = trace.fraction == 1.f || !trace.m_pEnt || !trace.m_pEnt->GetAbsVelocity().IsZero() || trace.surface.flags & SURF_SKY; #if defined(SPLASH_DEBUG1) || defined(SPLASH_DEBUG2) - if (pFrom && bErase) - G::LineStorage.emplace_back(std::pair(*pFrom, trace.endpos), I::GlobalVars->curtime + 60.f, Vars::Colors::Halloween.Value); + if (bDebug && pErase && bErase) + { + Vec3 vMins = Vec3(-1, -1, -1), vMaxs = Vec3(1, 1, 1); + Vec3 vAngles; Math::VectorAngles(trace.plane.normal, vAngles); + G::BoxStorage.emplace_back(trace.endpos, vMins, vMaxs, vAngles, I::GlobalVars->curtime + 60.f, Vars::Colors::Halloween.Value, Color_t(0, 0, 0, 0)); + G::LineStorage.emplace_back(std::pair(trace.startpos, trace.endpos), I::GlobalVars->curtime + 60.f, Vars::Colors::Halloween.Value); + } #endif + if (pErase) *pErase = bErase; if (bErase) return false; @@ -366,17 +379,23 @@ std::vector CAimbotProjectile::GetSplashPoints(Target_t& tTarget, std:: bNormal = vForward.Dot(trace.plane.normal) >= 0; } } + /* #if defined(SPLASH_DEBUG1) || defined(SPLASH_DEBUG2) - if (pFrom) + if (bDebug && pNormal) { - G::LineStorage.emplace_back(std::pair(*pFrom, trace.endpos), I::GlobalVars->curtime + 60.f, !bNormal ? Vars::Colors::TeamBlu.Value : Vars::Colors::TeamRed.Value); - //G::LineStorage.emplace_back(std::pair(trace.endpos, trace.endpos - vForward * 10), I::GlobalVars->curtime + 60.f, Vars::Colors::Local.Value); + Vec3 vMins = Vec3(-1, -1, -1) * (bNormal ? 0.5f : 1.f), vMaxs = Vec3(1, 1, 1) * (bNormal ? 0.5f : 1.f); + Vec3 vAngles; Math::VectorAngles(trace.plane.normal, vAngles); + G::BoxStorage.emplace_back(trace.endpos, vMins, vMaxs, vAngles, I::GlobalVars->curtime + 60.f, !bNormal ? Vars::Colors::TeamBlu.Value : Vars::Colors::TeamRed.Value, Color_t(0, 0, 0, 0)); + G::LineStorage.emplace_back(std::pair(trace.startpos, trace.endpos), I::GlobalVars->curtime + 60.f, !bNormal ? Vars::Colors::TeamBlu.Value : Vars::Colors::TeamRed.Value); } #endif + */ + if (pNormal) *pNormal = bNormal; if (bNormal) return false; bErase = tPoint.m_Solution.m_iCalculated == 1; + if (pErase) *pErase = bErase; if (!bErase || !tInfo.m_flPrimeTime && int(tPoint.m_Solution.m_flTime / TICK_INTERVAL) + 1 != iSimTime) return false; @@ -405,10 +424,17 @@ std::vector CAimbotProjectile::GetSplashPoints(Target_t& tTarget, std:: #ifdef SPLASH_DEBUG5 mTraceCount["Splash regular"]++; #endif + #ifndef SPLASH_DEBUG1 - checkPoint(trace, bErase, bNormal); + checkPoint(trace, &bErase, &bNormal); #else - checkPoint(trace, bErase, bNormal, &vTargetEye); + checkPoint(trace, &bErase, &bNormal, true); + { + Vec3 vMins = Vec3(-1, -1, -1) * (bNormal ? 0.5f : 1.f), vMaxs = Vec3(1, 1, 1) * (bNormal ? 0.5f : 1.f); + Vec3 vAngles; Math::VectorAngles(trace.plane.normal, vAngles); + G::BoxStorage.emplace_back(trace.endpos, vMins, vMaxs, vAngles, I::GlobalVars->curtime + 60.f, Vars::Colors::Local.Value.Alpha(Vars::Colors::Local.Value.a / (bNormal ? 10 : 1)), Color_t(0, 0, 0, 0)); + G::LineStorage.emplace_back(std::pair(trace.startpos, trace.endpos), I::GlobalVars->curtime + 60.f, Vars::Colors::Local.Value.Alpha(Vars::Colors::Local.Value.a / (bNormal ? 10 : 1))); + } #endif if (bErase) @@ -416,11 +442,12 @@ std::vector CAimbotProjectile::GetSplashPoints(Target_t& tTarget, std:: else if (bNormal) iType &= ~PointTypeEnum::Regular; else - iType &= ~PointTypeEnum::Obscured; + iType &= ~(PointTypeEnum::Obscured | PointTypeEnum::Multi1); } if (iType & PointTypeEnum::Obscured) { bool bErase = false, bNormal = false; + size_t iOriginalSize = vPointDistances.size(); switch (tInfo.m_iSplashMode) { @@ -433,106 +460,179 @@ std::vector CAimbotProjectile::GetSplashPoints(Target_t& tTarget, std:: #endif bNormal = trace.DidHit(); #ifdef SPLASH_DEBUG2 - G::LineStorage.emplace_back(std::pair(vPoint, trace.endpos), I::GlobalVars->curtime + 60.f, bNormal ? Vars::Colors::IndicatorGood.Value : Vars::Colors::IndicatorBad.Value); -#endif - if (!bNormal) { - SDK::TraceHull(vPoint, vTargetEye, tInfo.m_vHull * -1, tInfo.m_vHull, MASK_SOLID, &filter, &trace); + Vec3 vMins = Vec3(-1, -1, -1) * (bNormal ? 0.5f : 1.f), vMaxs = Vec3(1, 1, 1) * (bNormal ? 0.5f : 1.f); + Vec3 vAngles; Math::VectorAngles(trace.plane.normal, vAngles); + G::BoxStorage.emplace_back(trace.endpos, vMins, vMaxs, vAngles, I::GlobalVars->curtime + 60.f, Vars::Colors::IndicatorGood.Value.Alpha(Vars::Colors::IndicatorGood.Value.a / (bNormal ? 10 : 1)), Color_t(0, 0, 0, 0)); + G::LineStorage.emplace_back(std::pair(trace.startpos, trace.endpos), I::GlobalVars->curtime + 60.f, Vars::Colors::IndicatorGood.Value.Alpha(Vars::Colors::IndicatorGood.Value.a / (bNormal ? 10 : 1))); + } +#endif + if (bNormal) + break; + + SDK::TraceHull(vPoint, vTargetEye, tInfo.m_vHull * -1, tInfo.m_vHull, MASK_SOLID, &filter, &trace); #ifdef SPLASH_DEBUG5 - mTraceCount["Splash grate"]++; + mTraceCount["Splash grate"]++; #endif #ifndef SPLASH_DEBUG2 - checkPoint(trace, bErase, bNormal); + checkPoint(trace, &bErase, &bNormal); #else - checkPoint(trace, bErase, bNormal, &vPoint); + checkPoint(trace, &bErase, &bNormal, true); #endif - } break; } // currently experimental, there may be a more efficient way to do this? case Vars::Aimbot::Projectile::RocketSplashModeEnum::SpecialLight: + case Vars::Aimbot::Projectile::RocketSplashModeEnum::SpecialHeavy: { SDK::Trace(vPoint, vTargetEye, MASK_SOLID, &filter, &trace); #ifdef SPLASH_DEBUG5 mTraceCount["Splash rocket"]++; #endif - bNormal = trace.fraction == 1.f /*|| trace.startsolid*/; - if (!bNormal) + bNormal = trace.fraction == 1.f; +#ifdef SPLASH_DEBUG2 { -#ifndef SPLASH_DEBUG2 - if (checkPoint(trace, bErase, bNormal)) -#else - G::LineStorage.emplace_back(std::pair(vPoint, trace.endpos), I::GlobalVars->curtime + 60.f, Vars::Colors::IndicatorBad.Value); - if (checkPoint(trace, bErase, bNormal, &vPoint)) + Vec3 vMins = Vec3(-1, -1, -1) * (bNormal ? 0.5f : 1.f), vMaxs = Vec3(1, 1, 1) * (bNormal ? 0.5f : 1.f); + Vec3 vAngles; Math::VectorAngles(trace.plane.normal, vAngles); + G::BoxStorage.emplace_back(trace.endpos, vMins, vMaxs, vAngles, I::GlobalVars->curtime + 60.f, Vars::Colors::IndicatorMid.Value.Alpha(Vars::Colors::IndicatorMid.Value.a / (bNormal ? 10 : 1)), Color_t(0, 0, 0, 0)); + G::LineStorage.emplace_back(std::pair(trace.startpos, trace.endpos), I::GlobalVars->curtime + 60.f, Vars::Colors::IndicatorMid.Value.Alpha(Vars::Colors::IndicatorMid.Value.a / (bNormal ? 10 : 1))); + } #endif - { - SDK::Trace(trace.endpos + trace.plane.normal, vTargetEye, MASK_SHOT, &filter, &trace); + if (bNormal) + break; + + if (iType & PointTypeEnum::Multi2 && trace.surface.flags & SURF_NODRAW) + { + CGameTrace trace2 = {}; + SDK::Trace(trace.endpos - trace.plane.normal, vTargetEye, MASK_SOLID | CONTENTS_NOSTARTSOLID, &filter, &trace2); #ifdef SPLASH_DEBUG5 - mTraceCount["Splash rocket check"]++; + mTraceCount["Splash rocket (2)"]++; #endif - if (trace.fraction < 1.f) - vPointDistances.pop_back(); + bool bNormal2 = trace2.fraction == 1.f || (trace.endpos - trace.plane.normal - trace.endpos).IsZero(); +#ifdef SPLASH_DEBUG2 + { + Vec3 vMins = Vec3(-1, -1, -1) * (bNormal ? 0.5f : 1.f), vMaxs = Vec3(1, 1, 1) * (bNormal ? 0.5f : 1.f); + Vec3 vAngles; Math::VectorAngles(trace2.plane.normal, vAngles); + G::BoxStorage.emplace_back(trace2.endpos, vMins, vMaxs, vAngles, I::GlobalVars->curtime + 60.f, Vars::Colors::IndicatorBad.Value.Alpha(Vars::Colors::IndicatorBad.Value.a / (bNormal ? 10 : 1)), Color_t(0, 0, 0, 0)); + G::LineStorage.emplace_back(std::pair(trace2.startpos, trace2.endpos), I::GlobalVars->curtime + 60.f, Vars::Colors::IndicatorBad.Value.Alpha(Vars::Colors::IndicatorBad.Value.a / (bNormal ? 10 : 1))); } +#endif + if (!bNormal2) + trace = trace2; + else + iType &= ~PointTypeEnum::Multi2; + } + +#ifndef SPLASH_DEBUG2 + if (checkPoint(trace, &bErase, &bNormal)) +#else + if (checkPoint(trace, &bErase, &bNormal, true)) +#endif + { + SDK::Trace(trace.endpos + trace.plane.normal, vTargetEye, MASK_SHOT, &filter, &trace); +#ifdef SPLASH_DEBUG5 + mTraceCount["Splash rocket check"]++; +#endif +#ifdef SPLASH_DEBUG2 + { + Vec3 vMins = Vec3(-1, -1, -1) * (bNormal ? 0.5f : 1.f), vMaxs = Vec3(1, 1, 1) * (bNormal ? 0.5f : 1.f); + Vec3 vAngles; Math::VectorAngles(trace.plane.normal, vAngles); + G::BoxStorage.emplace_back(trace.endpos, vMins, vMaxs, vAngles, I::GlobalVars->curtime + 60.f, Vars::Colors::IndicatorMisc.Value.Alpha(Vars::Colors::IndicatorMisc.Value.a / (trace.fraction < 1.f ? 10 : 1)), Color_t(0, 0, 0, 0)); + G::LineStorage.emplace_back(std::pair(trace.startpos, trace.endpos), I::GlobalVars->curtime + 60.f, Vars::Colors::IndicatorMisc.Value.Alpha(Vars::Colors::IndicatorMisc.Value.a / (trace.fraction < 1.f ? 10 : 1))); + } +#endif + if (trace.fraction < 1.f) + vPointDistances.pop_back(); } break; } + } + + if (vPointDistances.size() != iOriginalSize) + iType = 0; + else if (bErase || bNormal) + iType &= ~PointTypeEnum::Obscured; + else + iType &= ~PointTypeEnum::Regular; + } + if (iType & PointTypeEnum::Multi1) + { + bool bErase = false, bNormal = false; + size_t iOriginalSize = vPointDistances.size(); + + switch (tInfo.m_iSplashMode) + { case Vars::Aimbot::Projectile::RocketSplashModeEnum::SpecialHeavy: { - SDK::Trace(vTargetEye, vPoint, MASK_SOLID, &filter, &trace); + SDK::TraceHull(vTargetEye, vPoint, tInfo.m_vHull * -1, tInfo.m_vHull, MASK_SOLID, &filter, &trace); #ifdef SPLASH_DEBUG5 - mTraceCount["Splash rocket"]++; + mTraceCount["Splash rocket (3)"]++; #endif - bErase = trace.fraction == 1.f /*|| trace.startsolid*/; - if (!bNormal) + bNormal = trace.fraction == 1.f; +#ifdef SPLASH_DEBUG2 { - std::vector> vPoints = { { trace.endpos + (vPoint - trace.endpos).Normalized(), vPoint, false }, { vPoint, vTargetEye, true } }; - for (auto& [vFrom, vTo, bErases] : vPoints) - { - bool bAdded = false; - - SDK::Trace(vFrom, vTo, MASK_SOLID, &filter, &trace); -#ifdef SPLASH_DEBUG5 - mTraceCount["Splash rocket (2)"]++; + Vec3 vMins = Vec3(-1, -1, -1) * (bNormal ? 0.5f : 1.f), vMaxs = Vec3(1, 1, 1) * (bNormal ? 0.5f : 1.f); + Vec3 vAngles; Math::VectorAngles(trace.plane.normal, vAngles); + G::BoxStorage.emplace_back(trace.endpos, vMins, vMaxs, vAngles, I::GlobalVars->curtime + 60.f, Vars::Colors::IndicatorTextMid.Value.Alpha(Vars::Colors::IndicatorTextMid.Value.a / (bNormal ? 10 : 1)), Color_t(0, 0, 0, 0)); + G::LineStorage.emplace_back(std::pair(trace.startpos, trace.endpos), I::GlobalVars->curtime + 60.f, Vars::Colors::IndicatorTextMid.Value.Alpha(Vars::Colors::IndicatorTextMid.Value.a / (bNormal ? 10 : 1))); + } #endif - if (trace.fraction < 1.f) - { + if (bNormal) + break; + + SDK::TraceHull(trace.endpos - trace.plane.normal, vPoint, tInfo.m_vHull * -1, tInfo.m_vHull, MASK_SOLID | CONTENTS_NOSTARTSOLID, &filter, &trace); +#ifdef SPLASH_DEBUG5 + mTraceCount["Splash rocket (4)"]++; +#endif + bNormal = trace.fraction == 1.f || (trace.startpos - trace.endpos).IsZero() || trace.allsolid; +#ifdef SPLASH_DEBUG2 + { + Vec3 vMins = Vec3(-1, -1, -1) * (bNormal ? 0.5f : 1.f), vMaxs = Vec3(1, 1, 1) * (bNormal ? 0.5f : 1.f); + Vec3 vAngles; Math::VectorAngles(trace.plane.normal, vAngles); + G::BoxStorage.emplace_back(trace.endpos, vMins, vMaxs, vAngles, I::GlobalVars->curtime + 60.f, Vars::Colors::IndicatorTextBad.Value.Alpha(Vars::Colors::IndicatorTextBad.Value.a / (bNormal ? 10 : 1)), Color_t(0, 0, 0, 0)); + G::LineStorage.emplace_back(std::pair(trace.startpos, trace.endpos), I::GlobalVars->curtime + 60.f, Vars::Colors::IndicatorTextBad.Value.Alpha(Vars::Colors::IndicatorTextBad.Value.a / (bNormal ? 10 : 1))); + } +#endif + if (bNormal) + break; + #ifndef SPLASH_DEBUG2 - if (checkPoint(trace, bErase, bNormal)) + if (checkPoint(trace, &bErase, &bNormal)) #else - G::LineStorage.emplace_back(std::pair(vFrom, trace.endpos), I::GlobalVars->curtime + 60.f, bErases ? Vars::Colors::IndicatorBad.Value : Vars::Colors::IndicatorGood.Value); - if (checkPoint(trace, bErase, bNormal, &vPoint)) + if (checkPoint(trace, &bErase, &bNormal, &vPoint)) #endif - { - SDK::Trace(trace.endpos + trace.plane.normal, vTargetEye, MASK_SHOT, &filter, &trace); + { + SDK::Trace(trace.endpos + trace.plane.normal, vTargetEye, MASK_SHOT, &filter, &trace); #ifdef SPLASH_DEBUG5 - mTraceCount["Splash rocket check"]++; + mTraceCount["Splash rocket check (2)"]++; #endif - bAdded = trace.fraction == 1.f; - if (!bAdded) - vPointDistances.pop_back(); - } - } - - if (!bErases && !bAdded) - bErase = bNormal = false; - if (bErase || bNormal) - break; +#ifdef SPLASH_DEBUG2 + { + Vec3 vMins = Vec3(-1, -1, -1) * (bNormal ? 0.5f : 1.f), vMaxs = Vec3(1, 1, 1) * (bNormal ? 0.5f : 1.f); + Vec3 vAngles; Math::VectorAngles(trace.plane.normal, vAngles); + G::BoxStorage.emplace_back(trace.endpos, vMins, vMaxs, vAngles, I::GlobalVars->curtime + 60.f, Vars::Colors::IndicatorTextMisc.Value.Alpha(Vars::Colors::IndicatorTextMisc.Value.a / (trace.fraction < 1.f ? 10 : 1)), Color_t(0, 0, 0, 0)); + G::LineStorage.emplace_back(std::pair(trace.startpos, trace.endpos), I::GlobalVars->curtime + 60.f, Vars::Colors::IndicatorTextMisc.Value.Alpha(Vars::Colors::IndicatorTextMisc.Value.a / (trace.fraction < 1.f ? 10 : 1))); } +#endif + if (trace.fraction < 1.f) + vPointDistances.pop_back(); } break; } + default: + iType &= ~PointTypeEnum::Multi1; } - if (bErase) + if (vPointDistances.size() != iOriginalSize) iType = 0; - else if (bNormal) - iType &= ~PointTypeEnum::Obscured; + if (bErase || bNormal) + iType &= ~PointTypeEnum::Multi1; else iType &= ~PointTypeEnum::Regular; } } - if (!iType) + if (!(iType & ~(PointTypeEnum::Multi1 | PointTypeEnum::Multi2))) it = vSpherePoints.erase(it); else ++it; @@ -1545,7 +1645,7 @@ bool CAimbotProjectile::RunMain(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUser #if defined(SPLASH_DEBUG1) || defined(SPLASH_DEBUG2) || defined(SPLASH_DEBUG4) G::LineStorage.clear(); #endif -#if defined(SPLASH_DEBUG3) || defined(SPLASH_DEBUG4) +#if defined(SPLASH_DEBUG1) || defined(SPLASH_DEBUG2) || defined(SPLASH_DEBUG3) || defined(SPLASH_DEBUG4) G::BoxStorage.clear(); #endif for (auto& tTarget : vTargets) diff --git a/Amalgam/src/Features/Aimbot/AimbotProjectile/AimbotProjectile.h b/Amalgam/src/Features/Aimbot/AimbotProjectile/AimbotProjectile.h index d306cc28..3cfd4b8e 100644 --- a/Amalgam/src/Features/Aimbot/AimbotProjectile/AimbotProjectile.h +++ b/Amalgam/src/Features/Aimbot/AimbotProjectile/AimbotProjectile.h @@ -3,7 +3,7 @@ #include "../AimbotGlobal/AimbotGlobal.h" -Enum(PointType, None = 0, Regular = 1 << 0, Obscured = 1 << 1) +Enum(PointType, None = 0, Regular = 1 << 0, Obscured = 1 << 1, Multi1 = 1 << 2, Multi2 = 1 << 3) struct Solution_t { diff --git a/Amalgam/src/Features/Binds/Binds.cpp b/Amalgam/src/Features/Binds/Binds.cpp index 9110215c..b2870678 100644 --- a/Amalgam/src/Features/Binds/Binds.cpp +++ b/Amalgam/src/Features/Binds/Binds.cpp @@ -167,7 +167,7 @@ void CBinds::AddBind(int iBind, Bind_t& tBind) m_vBinds[iBind] = tBind; } -#define HasType(type, bind) IsType(type) && var->As()->Map.find(bind) != var->As()->Map.end() +#define HasType(type, bind) IsType(type) && var->As()->contains(bind) #define RemoveType(type, bind)\ {\ diff --git a/Amalgam/src/Features/Configs/Configs.cpp b/Amalgam/src/Features/Configs/Configs.cpp index dcd2d596..c181a2e8 100644 --- a/Amalgam/src/Features/Configs/Configs.cpp +++ b/Amalgam/src/Features/Configs/Configs.cpp @@ -469,7 +469,7 @@ bool CConfigs::LoadConfig(const std::string& sConfigName, bool bNotify) } } - H::Fonts.Reload(Vars::Menu::Scale.Map[DEFAULT_BIND]); + H::Fonts.Reload(Vars::Menu::Scale[DEFAULT_BIND]); m_sCurrentConfig = sConfigName; m_sCurrentVisuals = ""; if (bNotify) diff --git a/Amalgam/src/Features/CritHack/CritHack.cpp b/Amalgam/src/Features/CritHack/CritHack.cpp index 86008a9e..96d304ef 100644 --- a/Amalgam/src/Features/CritHack/CritHack.cpp +++ b/Amalgam/src/Features/CritHack/CritHack.cpp @@ -204,7 +204,7 @@ void CCritHack::GetTotalCrits(CTFPlayer* pLocal, CTFWeaponBase* pWeapon) void CCritHack::CanFireCritical(CTFPlayer* pLocal, CTFWeaponBase* pWeapon) { m_bCritBanned = false; - m_iDamageTilUnban = 0; + m_flDamageTilFlip = 0; if (pWeapon->GetSlot() == SLOT_MELEE) m_flCritChance = TF_DAMAGE_CRIT_CHANCE_MELEE * pLocal->GetCritMult(); @@ -218,14 +218,18 @@ void CCritHack::CanFireCritical(CTFPlayer* pLocal, CTFWeaponBase* pWeapon) m_flCritChance = TF_DAMAGE_CRIT_CHANCE * pLocal->GetCritMult(); m_flCritChance = SDK::AttribHookValue(m_flCritChance, "mult_crit_chance", pWeapon); - if (!m_iAllDamage || !m_iCritDamage || pWeapon->GetSlot() == SLOT_MELEE) - return; - const float flNormalizedDamage = m_iCritDamage / TF_DAMAGE_CRIT_MULTIPLIER; - const float flObservedCritChance = flNormalizedDamage / (flNormalizedDamage + m_iAllDamage - m_iCritDamage); float flCritChance = m_flCritChance + 0.1f; - if (m_bCritBanned = flObservedCritChance > flCritChance) - m_iDamageTilUnban = flNormalizedDamage / flCritChance + m_iCritDamage - flNormalizedDamage - m_iAllDamage; + if (m_iAllDamage && m_iCritDamage) + { + const float flObservedCritChance = flNormalizedDamage / (flNormalizedDamage + m_iAllDamage - m_iCritDamage); + m_bCritBanned = flObservedCritChance > flCritChance; + } + + if (m_bCritBanned) + m_flDamageTilFlip = flNormalizedDamage / flCritChance + flNormalizedDamage * 2 - m_iAllDamage; + else + m_flDamageTilFlip = 3 * (flNormalizedDamage - flCritChance * (flNormalizedDamage + m_iAllDamage - m_iCritDamage)) / (flCritChance - 1); } bool CCritHack::WeaponCanCrit(CTFWeaponBase* pWeapon, bool bWeaponOnly) @@ -301,7 +305,7 @@ void CCritHack::Reset() m_iAllDamage = 0; m_bCritBanned = false; - m_iDamageTilUnban = 0; + m_flDamageTilFlip = 0; m_flCritChance = 0.f; m_mHealthStorage.clear(); @@ -577,7 +581,7 @@ void CCritHack::Draw(CTFPlayer* pLocal) } } else - H::Draw.StringOutlined(fFont, x, y += nTall, Vars::Colors::IndicatorTextBad.Value, Vars::Menu::Theme::Background.Value, align, std::format("Deal {} damage", m_iDamageTilUnban).c_str()); + H::Draw.StringOutlined(fFont, x, y += nTall, Vars::Colors::IndicatorTextBad.Value, Vars::Menu::Theme::Background.Value, align, std::format("Deal {} damage", ceilf(m_flDamageTilFlip)).c_str()); int iCrits = tStorage.m_iAvailableCrits; H::Draw.StringOutlined(fFont, x, y += nTall, Vars::Menu::Theme::Active.Value, Vars::Menu::Theme::Background.Value, align, std::format("{}{} / {} potential crits", iCrits, iCrits == 1000 ? "+" : "", tStorage.m_iPotentialCrits).c_str()); @@ -587,6 +591,9 @@ void CCritHack::Draw(CTFPlayer* pLocal) int iShots = tStorage.m_iNextCrit; H::Draw.StringOutlined(fFont, x, y += nTall, Vars::Menu::Theme::Active.Value, Vars::Menu::Theme::Background.Value, align, std::format("Next in {}{} shot{}", iShots, iShots == 1000 ? "+" : "", iShots == 1 ? "" : "s").c_str()); } + + if (!m_bCritBanned && iSlot != SLOT_MELEE && m_flDamageTilFlip) + H::Draw.StringOutlined(fFont, x, y += nTall, Vars::Colors::IndicatorTextGood.Value, Vars::Menu::Theme::Background.Value, align, std::format("{} damage", floor(m_flDamageTilFlip)).c_str()); } else H::Draw.StringOutlined(fFont, x, y += nTall, Vars::Menu::Theme::Active.Value, Vars::Menu::Theme::Background.Value, align, "Calculating"); diff --git a/Amalgam/src/Features/CritHack/CritHack.h b/Amalgam/src/Features/CritHack/CritHack.h index 6293d462..714e2bad 100644 --- a/Amalgam/src/Features/CritHack/CritHack.h +++ b/Amalgam/src/Features/CritHack/CritHack.h @@ -44,7 +44,7 @@ private: std::unordered_map m_mHealthStorage = {}; bool m_bCritBanned = false; - int m_iDamageTilUnban = 0; + float m_flDamageTilFlip = 0; float m_flCritChance = 0.f; int m_iWishRandomSeed = 0; diff --git a/Amalgam/src/Features/ImGui/Fonts/MaterialDesign/IconDefinitions.h b/Amalgam/src/Features/ImGui/Fonts/MaterialDesign/IconDefinitions.h index 6798a024..2f934ce5 100644 --- a/Amalgam/src/Features/ImGui/Fonts/MaterialDesign/IconDefinitions.h +++ b/Amalgam/src/Features/ImGui/Fonts/MaterialDesign/IconDefinitions.h @@ -1,6 +1,8 @@ -// Generated by https://github.com/juliettef/IconFontCppHeaders script GenerateIconFontCppHeaders.py for languages C and C++ -// from https://github.com/google/material-design-icons/raw/master/font/MaterialIcons-Regular.codepoints -// for use with https://github.com/google/material-design-icons/blob/master/font/MaterialIcons-Regular.ttf +// Generated by https://github.com/juliettef/IconFontCppHeaders script GenerateIconFontCppHeaders.py +// for C and C++ +// from codepoints https://github.com/google/material-design-icons/raw/master/font/MaterialIcons-Regular.codepoints +// for use with font https://github.com/google/material-design-icons/blob/master/font/MaterialIcons-Regular.ttf + #pragma once #define FONT_ICON_FILE_NAME_MD "MaterialIcons-Regular.ttf" @@ -8,6 +10,7 @@ #define ICON_MIN_MD 0xe000 #define ICON_MAX_16_MD 0xf8ff #define ICON_MAX_MD 0x10fffd + #define ICON_MD_10K "\xee\xa5\x91" // U+e951 #define ICON_MD_10MP "\xee\xa5\x92" // U+e952 #define ICON_MD_11MP "\xee\xa5\x93" // U+e953 diff --git a/Amalgam/src/Features/ImGui/Menu/Components.h b/Amalgam/src/Features/ImGui/Menu/Components.h index 078d7b06..babc1ff6 100644 --- a/Amalgam/src/Features/ImGui/Menu/Components.h +++ b/Amalgam/src/Features/ImGui/Menu/Components.h @@ -142,11 +142,14 @@ namespace ImGui vDisabled.pop_back(); Disabled = !vDisabled.empty() ? vDisabled.back() : false; } - inline void PushTransparent(bool bTransparent) + inline void PushTransparent(bool bTransparent, bool bPushAlpha = false) { vTransparent.push_back(Transparent = bTransparent); + + if (bPushAlpha) + PushStyleVar(ImGuiStyleVar_Alpha, !bTransparent ? 1.f : 0.5f); } - inline void PopTransparent(int count = 1) + inline void PopTransparent(int count = 1, int iPopAlpha = false) { int iSize = int(vTransparent.size()); if (iSize < count) @@ -157,6 +160,9 @@ namespace ImGui for (int i = 0; i < count; i++) vTransparent.pop_back(); Transparent = !vTransparent.empty() ? vTransparent.back() : false; + + if (iPopAlpha) + PopStyleVar(iPopAlpha); } inline float fnmodf(float flX, float flY) @@ -1907,18 +1913,22 @@ namespace ImGui SetCursorPos(vOriginalPos); } + PushStyleVar(ImGuiStyleVar_Alpha, 1.f); PushStyleVar(ImGuiStyleVar_FramePadding, { H::Draw.Scale(2), H::Draw.Scale(2) }); PushStyleVar(ImGuiStyleVar_ItemSpacing, { 0, H::Draw.Scale(4) }); PushStyleVar(ImGuiStyleVar_ItemInnerSpacing, { H::Draw.Scale(4), 0 }); PushStyleColor(ImGuiCol_PopupBg, F::Render.Background0p5.Value); + ImVec4 tempColor = ColorToVec(*tColor); bool bReturn = ColorEdit4(std::format("##{}", sLabel).c_str(), &tempColor.x, ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoLabel | ImGuiColorEditFlags_NoBorder | ImGuiColorEditFlags_NoTooltip | ImGuiColorEditFlags_AlphaBar | ImGuiColorEditFlags_LargeAlphaGrid, vSize); if (bReturn) *tColor = VecToColor(tempColor); - PopStyleColor(); - PopStyleVar(3); if (!Disabled && IsItemHovered()) SetMouseCursor(ImGuiMouseCursor_Hand); + + PopStyleColor(); + PopStyleVar(4); + if (bTooltip) FTooltip(sLabel); @@ -2341,7 +2351,7 @@ namespace ImGui int iParent = CurrentBind; while (true) { - if (iParent == DEFAULT_BIND || var.Map.contains(iParent)) + if (iParent == DEFAULT_BIND || var.contains(iParent)) break; iParent = F::Binds.GetParent(iParent); } @@ -2355,10 +2365,10 @@ namespace ImGui while (true) { iParent = F::Binds.GetParent(iParent); - if (iParent == DEFAULT_BIND || var.Map.contains(iParent)) + if (iParent == DEFAULT_BIND || var.contains(iParent)) break; } - return var.Map[iParent]; + return var[iParent]; } bool bPushedDisabled = false, bPushedTransparent = false; @@ -2373,7 +2383,7 @@ namespace ImGui if (CurrentBind == DEFAULT_BIND) { - if (Vars::Menu::MenuShowsBinds.Value && var.Map[DEFAULT_BIND] != var.Value) + if (Vars::Menu::MenuShowsBinds.Value && var[DEFAULT_BIND] != var.Value) { for (auto& [_iBind, tVal] : var.Map) { @@ -2395,7 +2405,7 @@ namespace ImGui bPushedTransparent = true; } } - return var.Map[iBind]; + return var[iBind]; } template @@ -2407,7 +2417,7 @@ namespace ImGui auto tVal = GetParentValue(var, iBind); if (tVal != val) - var.Map[iBind] = val; + var[iBind] = val; else if (iBind != DEFAULT_BIND) { for (auto it = var.Map.begin(); it != var.Map.end();) @@ -2467,8 +2477,8 @@ namespace ImGui tBind = F::Binds.m_vBinds[iBind]; else tBind = { sBind }; - if (var.Map.contains(iBind)) - val = var.Map[iBind]; + if (var.contains(iBind)) + val = var[iBind]; } bool bClickedNew = iBind == DEFAULT_BIND && bLastHovered && IsMouseDown(ImGuiMouseButton_Left); if (iModified != -2 || bClickedNew) @@ -2528,7 +2538,7 @@ namespace ImGui if (!Disabled && iBind != DEFAULT_BIND && iBind < F::Binds.m_vBinds.size()) { - var.Map[iBind] = val; + var[iBind] = val; // don't completely override to retain misc info auto& _tBind = F::Binds.m_vBinds[iBind]; diff --git a/Amalgam/src/Features/ImGui/Menu/Menu.cpp b/Amalgam/src/Features/ImGui/Menu/Menu.cpp index d438cfa5..1561883a 100644 --- a/Amalgam/src/Features/ImGui/Menu/Menu.cpp +++ b/Amalgam/src/Features/ImGui/Menu/Menu.cpp @@ -268,8 +268,9 @@ void CMenu::MenuAimbot(int iTab) FSlider("Splash points", Vars::Aimbot::Projectile::SplashPoints, 1, 400, 5, "%i", FSlider_Left | FSlider_Min); FToggle("Splash grates", Vars::Aimbot::Projectile::SplashGrates, FToggle_Right); - FSlider("Splash Nth root", Vars::Aimbot::Projectile::SplashNthRoot, 0.5f, 2.f, 0.1f, "%g", FSlider_Left | FSlider_Min); - FSlider("Splash rotate", Vars::Aimbot::Projectile::SplashRotate, 0.f, 360.f, 1.f, "%g%%", FSlider_Right | FSlider_Min); + FSlider("Splash Rx", Vars::Aimbot::Projectile::SplashRotateX, -1.f, 360.f, 1.f, Vars::Aimbot::Projectile::SplashRotateX[DEFAULT_BIND] < 0.f ? "random" : "%g", FSlider_Left | FSlider_Min); + FSlider("Splash Ry", Vars::Aimbot::Projectile::SplashRotateY, -1.f, 360.f, 1.f, Vars::Aimbot::Projectile::SplashRotateY[DEFAULT_BIND] < 0.f ? "random" : "%g", FSlider_Right | FSlider_Min); + FSlider("Splash Nth root", Vars::Aimbot::Projectile::SplashNthRoot, 0.5f, 2.f, 0.1f, "%g", FSlider_Min); FSlider("Direct splash count", Vars::Aimbot::Projectile::SplashCountDirect, 1, 100, 1, "%i", FSlider_Left | FSlider_Min); FSlider("Arc splash count", Vars::Aimbot::Projectile::SplashCountArc, 1, 100, 1, "%i", FSlider_Right | FSlider_Min); FSlider("Splash trace interval", Vars::Aimbot::Projectile::SplashTraceInterval, 1, 10, 1, "%i", FSlider_Left); @@ -583,13 +584,15 @@ void CMenu::MenuVisuals(int iTab) if (Section("Backtrack", true)) { FToggle("Enabled", Vars::Chams::Backtrack::Enabled, FToggle_Left, nullptr, "Backtrack chams"); + FToggle("Ignore Z", Vars::Chams::Backtrack::IgnoreZ, FToggle_Right, nullptr, "Backtrack ignore Z"); FMDropdown("Material", Vars::Chams::Backtrack::Visible, FDropdown_Left, 0, nullptr, "Backtrack material"); FDropdown("Draw", Vars::Chams::Backtrack::Draw, { "Last", "Last + first", "All" }, {}, FDropdown_Right, 0, nullptr, "Backtrack chams mode"); } EndSection(); if (Section("Fake Angle", true)) { - FToggle("Enabled", Vars::Chams::FakeAngle::Enabled, FToggle_None, nullptr, "Fake angle chams"); + FToggle("Enabled", Vars::Chams::FakeAngle::Enabled, FToggle_Left, nullptr, "Fake angle chams"); + FToggle("Ignore Z", Vars::Chams::FakeAngle::IgnoreZ, FToggle_Right, nullptr, "Fake angle ignore Z"); FMDropdown("Material", Vars::Chams::FakeAngle::Visible, FDropdown_None, 0, nullptr, "Fake angle material"); } EndSection(); @@ -692,6 +695,11 @@ void CMenu::MenuVisuals(int iTab) if (Section("Backtrack", true)) { FToggle("Enabled", Vars::Glow::Backtrack::Enabled, FToggle_Left, nullptr, "Backtrack glow"); + PushTransparent(!FGet(Vars::Colors::Backtrack).a); + { + FColorPicker("Color", Vars::Colors::Backtrack, 0, FColorPicker_Middle, nullptr, "Backtrack color"); + } + PopTransparent(); PushTransparent(!FGet(Vars::Glow::Backtrack::Stencil)); { @@ -707,7 +715,12 @@ void CMenu::MenuVisuals(int iTab) } EndSection(); if (Section("Fake Angle", true)) { - FToggle("Enabled", Vars::Glow::FakeAngle::Enabled, FToggle_None, nullptr, "Fake angle glow"); + FToggle("Enabled", Vars::Glow::FakeAngle::Enabled, FToggle_Left, nullptr, "Fake angle glow"); + PushTransparent(!FGet(Vars::Colors::FakeAngle).a); + { + FColorPicker("Color", Vars::Colors::FakeAngle, 0, FColorPicker_Middle, nullptr, "Fake angle color"); + } + PopTransparent(); PushTransparent(!FGet(Vars::Glow::FakeAngle::Stencil)); { @@ -1066,19 +1079,19 @@ void CMenu::MenuVisuals(int iTab) FSDropdown("Cheat title", Vars::Menu::CheatName, {}, FDropdown_Left | FSDropdown_AutoUpdate); FSDropdown("Chat info prefix", Vars::Menu::CheatPrefix, {}, FDropdown_Right); - FKeybind("Primary key", Vars::Menu::MenuPrimaryKey.Map[DEFAULT_BIND], FButton_Left | FKeybind_AllowMenu); - FKeybind("Secondary key", Vars::Menu::MenuSecondaryKey.Map[DEFAULT_BIND], FButton_Right | FButton_SameLine | FKeybind_AllowMenu); - switch (Vars::Menu::MenuPrimaryKey.Map[DEFAULT_BIND]) + FKeybind("Primary key", Vars::Menu::MenuPrimaryKey[DEFAULT_BIND], FButton_Left | FKeybind_AllowMenu); + FKeybind("Secondary key", Vars::Menu::MenuSecondaryKey[DEFAULT_BIND], FButton_Right | FButton_SameLine | FKeybind_AllowMenu); + switch (Vars::Menu::MenuPrimaryKey[DEFAULT_BIND]) { case VK_LBUTTON: case VK_RBUTTON: - Vars::Menu::MenuPrimaryKey.Map[DEFAULT_BIND] = Vars::Menu::MenuPrimaryKey.Default; + Vars::Menu::MenuPrimaryKey[DEFAULT_BIND] = Vars::Menu::MenuPrimaryKey.Default; } - switch (Vars::Menu::MenuSecondaryKey.Map[DEFAULT_BIND]) + switch (Vars::Menu::MenuSecondaryKey[DEFAULT_BIND]) { case VK_LBUTTON: case VK_RBUTTON: - Vars::Menu::MenuSecondaryKey.Map[DEFAULT_BIND] = Vars::Menu::MenuSecondaryKey.Default; + Vars::Menu::MenuSecondaryKey[DEFAULT_BIND] = Vars::Menu::MenuSecondaryKey.Default; } } EndSection(); @@ -1088,7 +1101,7 @@ void CMenu::MenuVisuals(int iTab) { FDropdown("Indicators", Vars::Menu::Indicators, { "Ticks", "Crit hack", "Spectators", "Ping", "Conditions", "Seed prediction" }, {}, FDropdown_Multi); if (FSlider("Scale", Vars::Menu::Scale, 0.75f, 2.f, 0.25f, "%g", FSlider_Min | FSlider_Precision | FSlider_NoAutoUpdate)) - H::Fonts.Reload(Vars::Menu::Scale.Map[DEFAULT_BIND]); + H::Fonts.Reload(Vars::Menu::Scale[DEFAULT_BIND]); FToggle("Cheap text", Vars::Menu::CheapText); } EndSection(); if (Vars::Debug::Options.Value) @@ -1897,17 +1910,33 @@ void CMenu::MenuSettings(int iTab) if (_tBind.m_bNot && (_tBind.m_iType != BindEnum::Key || _tBind.m_iInfo == BindEnum::KeyEnum::Hold)) sType = std::format("not {}", sType); - ImVec2 vOriginalPos = { H::Draw.Scale(8) + H::Draw.Scale(28) * x, H::Draw.Scale(108) + H::Draw.Scale(36) * y }; + ImVec2 vOriginalPos = { H::Draw.Scale(8) + H::Draw.Scale(28) * std::min(x, 3), H::Draw.Scale(108) + H::Draw.Scale(36) * y }; // background - float flWidth = GetWindowWidth() - GetStyle().WindowPadding.x * 2 - H::Draw.Scale(28) * x; + float flWidth = GetWindowWidth() - GetStyle().WindowPadding.x * 2 - H::Draw.Scale(28) * std::min(x, 3); float flHeight = H::Draw.Scale(28); ImVec2 vDrawPos = GetDrawPos() + vOriginalPos; - GetWindowDrawList()->AddRectFilled(vDrawPos, { vDrawPos.x + flWidth, vDrawPos.y + flHeight }, F::Render.Background1p5, H::Draw.Scale(3)); + if (iBind != _iBind) + GetWindowDrawList()->AddRectFilled(vDrawPos, { vDrawPos.x + flWidth, vDrawPos.y + flHeight }, F::Render.Background1p5, H::Draw.Scale(3)); + else + { + ImColor tColor = F::Render.Background1p5L; + GetWindowDrawList()->AddRectFilled(vDrawPos, { vDrawPos.x + flWidth, vDrawPos.y + flHeight }, tColor, H::Draw.Scale(3)); + + tColor = ColorToVec((VecToColor(F::Render.Background1p5)).Lerp({ 127, 127, 127 }, 1.f / 9, LerpEnum::NoAlpha)); + GetWindowDrawList()->AddRect(vDrawPos, { vDrawPos.x + flWidth, vDrawPos.y + flHeight }, tColor, H::Draw.Scale(3), ImDrawFlags_None, H::Draw.Scale()); + } // text + if (x > 3) + { // don't indent too much + auto sText = std::format("-> {}", x); + SetCursorPos({ vOriginalPos.x - FCalcTextSize(sText.c_str()).x - H::Draw.Scale(10), vOriginalPos.y + H::Draw.Scale(7) }); + FText(sText.c_str()); + } + float flTextWidth = flWidth - H::Draw.Scale(127); - PushStyleVar(ImGuiStyleVar_Alpha, F::Binds.WillBeEnabled(_iBind) ? 1.f : 0.5f); + PushTransparent(!F::Binds.WillBeEnabled(_iBind), true); SetCursorPos({ vOriginalPos.x + H::Draw.Scale(10), vOriginalPos.y + H::Draw.Scale(7) }); FText(TruncateText(_tBind.m_sName, flTextWidth* (1.f / 3) - H::Draw.Scale(20)).c_str()); @@ -1930,16 +1959,18 @@ void CMenu::MenuSettings(int iTab) SetCursorPos({ vOriginalPos.x + flWidth - H::Draw.Scale(iOffset += 25), vOriginalPos.y + H::Draw.Scale(6) }); bool bNot = IconButton(!_tBind.m_bNot ? ICON_MD_CODE : ICON_MD_CODE_OFF); + PushTransparent(Transparent || !_tBind.m_bVisible, true); SetCursorPos({ vOriginalPos.x + flWidth - H::Draw.Scale(iOffset += 25), vOriginalPos.y + H::Draw.Scale(6) }); bool bVisibility = IconButton(_tBind.m_bVisible ? ICON_MD_VISIBILITY : ICON_MD_VISIBILITY_OFF); + PopTransparent(1, 1); SetCursorPos({ vOriginalPos.x + flWidth - H::Draw.Scale(iOffset += 25), vOriginalPos.y + H::Draw.Scale(6) }); - bool bEnable = IconButton(_tBind.m_bEnabled ? ICON_MD_RADIO_BUTTON_ON : ICON_MD_RADIO_BUTTON_OFF); + bool bEnable = IconButton(_tBind.m_bEnabled ? ICON_MD_TOGGLE_ON : ICON_MD_TOGGLE_OFF); SetCursorPos(vOriginalPos); bool bClicked = Button(std::format("##{}", _iBind).c_str(), { flWidth, flHeight }); - PopStyleVar(); + PopTransparent(1, 1); if (bClicked) { @@ -1947,6 +1978,18 @@ void CMenu::MenuSettings(int iTab) { bParent = false; tBind.m_iParent = _iBind; + + // make sure bind can't be parented to itself or any of its children + int _iBind2 = _iBind; + Bind_t _tBind2; + while (true) + { + if (_iBind2 == iBind) + tBind.m_iParent = DEFAULT_BIND; + if (!F::Binds.GetBind(_iBind2, &_tBind2)) + break; + _iBind2 = _tBind2.m_iParent; + } } else { @@ -2016,15 +2059,14 @@ void CMenu::MenuSettings(int iTab) { switch (team) { - case 3: return Color_t(100, 150, 200, alive ? 255 : 127).Lerp(Vars::Menu::Theme::Background.Value, 0.5f, false); - case 2: return Color_t(255, 100, 100, alive ? 255 : 127).Lerp(Vars::Menu::Theme::Background.Value, 0.5f, false); + case 3: return Color_t(100, 150, 200, alive ? 255 : 127).Lerp(Vars::Menu::Theme::Background.Value, 0.5f, LerpEnum::NoAlpha); + case 2: return Color_t(255, 100, 100, alive ? 255 : 127).Lerp(Vars::Menu::Theme::Background.Value, 0.5f, LerpEnum::NoAlpha); } - return Color_t(127, 127, 127, 255).Lerp(Vars::Menu::Theme::Background.Value, 0.5f, false); + return Color_t(127, 127, 127, 255).Lerp(Vars::Menu::Theme::Background.Value, 0.5f, LerpEnum::NoAlpha); }; auto drawPlayer = [getTeamColor](const ListPlayer& player, int x, int y) { - const Color_t teamColor = getTeamColor(player.m_iTeam, player.m_bAlive); - const ImColor imColor = ColorToVec(teamColor); + ImColor tColor = ColorToVec(getTeamColor(player.m_iTeam, player.m_bAlive)); ImVec2 vOriginalPos = { !x ? GetStyle().WindowPadding.x : GetWindowWidth() / 2 + GetStyle().WindowPadding.x / 2, H::Draw.Scale(36 + 36 * y) }; @@ -2032,7 +2074,7 @@ void CMenu::MenuSettings(int iTab) float flWidth = GetWindowWidth() / 2 - GetStyle().WindowPadding.x * 1.5f; float flHeight = H::Draw.Scale(28); ImVec2 vDrawPos = GetDrawPos() + vOriginalPos; - GetWindowDrawList()->AddRectFilled(vDrawPos, { vDrawPos.x + flWidth, vDrawPos.y + flHeight }, imColor, H::Draw.Scale(3)); + GetWindowDrawList()->AddRectFilled(vDrawPos, { vDrawPos.x + flWidth, vDrawPos.y + flHeight }, tColor, H::Draw.Scale(3)); // text + icons int lOffset = H::Draw.Scale(10); @@ -2108,14 +2150,14 @@ void CMenu::MenuSettings(int iTab) float flTagOffset = 0; for (auto& [pTag, iID] : vTags) { - ImColor tagColor = ColorToVec(pTag->Color); + ImColor tTagColor = ColorToVec(pTag->Color); float flTagWidth = FCalcTextSize(pTag->Name.c_str()).x + H::Draw.Scale(!iID ? 10 : 25); float flTagHeight = H::Draw.Scale(20); ImVec2 vTagPos = { flTagOffset, H::Draw.Scale(4) }; - PushStyleColor(ImGuiCol_Text, IsColorDark(tagColor) ? ImVec4{ 1, 1, 1, 1 } : ImVec4{ 0, 0, 0, 1 }); + PushStyleColor(ImGuiCol_Text, IsColorDark(tTagColor) ? ImVec4{ 1, 1, 1, 1 } : ImVec4{ 0, 0, 0, 1 }); - GetWindowDrawList()->AddRectFilled(vDrawPos + vTagPos, { vDrawPos.x + vTagPos.x + flTagWidth, vDrawPos.y + vTagPos.y + flTagHeight }, tagColor, H::Draw.Scale(3)); + GetWindowDrawList()->AddRectFilled(vDrawPos + vTagPos, { vDrawPos.x + vTagPos.x + flTagWidth, vDrawPos.y + vTagPos.y + flTagHeight }, tTagColor, H::Draw.Scale(3)); SetCursorPos({ vTagPos.x + H::Draw.Scale(5), vTagPos.y + H::Draw.Scale(4) }); FText(pTag->Name.c_str()); SetCursorPos({ vTagPos.x + flTagWidth - H::Draw.Scale(18), vTagPos.y + H::Draw.Scale(2) }); @@ -2474,9 +2516,18 @@ void CMenu::MenuSettings(int iTab) // background float flWidth = GetWindowWidth() * (_tTag.Label ? 1.f / 3 : 2.f / 3) - GetStyle().WindowPadding.x * 1.5f; float flHeight = H::Draw.Scale(28); - ImColor imColor = ColorToVec(_tTag.Color.Lerp(Vars::Menu::Theme::Background.Value, 0.5f, false)); + ImColor tColor = ColorToVec(_tTag.Color.Lerp(Vars::Menu::Theme::Background.Value, 0.5f, LerpEnum::NoAlpha)); ImVec2 vDrawPos = GetDrawPos() + vOriginalPos; - GetWindowDrawList()->AddRectFilled(vDrawPos, { vDrawPos.x + flWidth, vDrawPos.y + flHeight }, imColor, H::Draw.Scale(3)); + if (iID != _iID) + GetWindowDrawList()->AddRectFilled(vDrawPos, { vDrawPos.x + flWidth, vDrawPos.y + flHeight }, tColor, H::Draw.Scale(3)); + else + { + ImColor tColor2 = { tColor.Value.x * 1.1f, tColor.Value.y * 1.1f, tColor.Value.z * 1.1f, tColor.Value.w }; + GetWindowDrawList()->AddRectFilled(vDrawPos, { vDrawPos.x + flWidth, vDrawPos.y + flHeight }, tColor2, H::Draw.Scale(3)); + + tColor2 = ColorToVec(_tTag.Color.Lerp(Vars::Menu::Theme::Background.Value, 0.25f, LerpEnum::NoAlpha)); + GetWindowDrawList()->AddRect(vDrawPos, { vDrawPos.x + flWidth, vDrawPos.y + flHeight }, tColor2, H::Draw.Scale(3), ImDrawFlags_None, H::Draw.Scale()); + } // text SetCursorPos({ vOriginalPos.x + H::Draw.Scale(10), vOriginalPos.y + H::Draw.Scale(7) }); @@ -2883,7 +2934,8 @@ void CMenu::MenuSettings(int iTab) /* Column 1 */ TableNextColumn(); - if (Section("Manager")) + bool bManager = Section("Manager"); + if (bManager) { static std::string newName; FSDropdown("Material name", &newName, {}, FDropdown_Left | FSDropdown_AutoUpdate); @@ -2956,6 +3008,8 @@ void CMenu::MenuSettings(int iTab) SetCursorPos(vOriginalPos); DebugDummy({ 0, H::Draw.Scale(28) }); } } EndSection(); + if (!bManager) + SetScrollY(0); SetCursorPosY(GetCursorPosY() - 8); if (FButton("Folder", FButton_Fit)) ShellExecuteA(NULL, NULL, F::Configs.m_sMaterialsPath.c_str(), NULL, NULL, SW_SHOWNORMAL); @@ -3214,7 +3268,7 @@ void CMenu::DrawBinds() float flHeight = H::Draw.Scale(18 * vInfo.size() + (Vars::Menu::BindWindowTitle.Value ? 42 : 12)); SetNextWindowSize({ flWidth, flHeight }); PushStyleVar(ImGuiStyleVar_WindowMinSize, { H::Draw.Scale(40), H::Draw.Scale(40) }); - if (Begin("Binds", nullptr, ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_AlwaysAutoResize)) + if (Begin("Binds", nullptr, ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoFocusOnAppearing)) { ImVec2 vWindowPos = GetWindowPos(); @@ -3246,7 +3300,7 @@ void CMenu::DrawBinds() float flPosX = 0; if (m_bIsOpen) - PushStyleVar(ImGuiStyleVar_Alpha, F::Binds.WillBeEnabled(iBind) ? 1.f : 0.5f); + PushTransparent(!F::Binds.WillBeEnabled(iBind), true); SetCursorPos({ flPosX += H::Draw.Scale(12), H::Draw.Scale(iListStart + 18 * i) }); PushStyleColor(ImGuiCol_Text, tBind.m_bActive ? F::Render.Accent.Value : F::Render.Inactive.Value); @@ -3269,11 +3323,15 @@ void CMenu::DrawBinds() SetCursorPos({ flWidth - H::Draw.Scale(50), H::Draw.Scale(iListStart - 1 + 18 * i) }); bool bNot = IconButton(!tBind.m_bNot ? ICON_MD_CODE : ICON_MD_CODE_OFF); + PushTransparent(Transparent || !tBind.m_bVisible, true); SetCursorPos({ flWidth - H::Draw.Scale(75), H::Draw.Scale(iListStart - 1 + 18 * i) }); bool bVisibility = IconButton(tBind.m_bVisible ? ICON_MD_VISIBILITY : ICON_MD_VISIBILITY_OFF); + PopTransparent(1, 1); SetCursorPos({ flWidth - H::Draw.Scale(100), H::Draw.Scale(iListStart - 1 + 18 * i) }); - bool bEnable = IconButton(tBind.m_bEnabled ? ICON_MD_RADIO_BUTTON_ON : ICON_MD_RADIO_BUTTON_OFF); + bool bEnable = IconButton(tBind.m_bEnabled ? ICON_MD_TOGGLE_ON : ICON_MD_TOGGLE_OFF); + + PopTransparent(1, 1); PushFont(F::Render.FontRegular); PushStyleVar(ImGuiStyleVar_WindowPadding, { H::Draw.Scale(8), H::Draw.Scale(8) }); @@ -3311,9 +3369,6 @@ void CMenu::DrawBinds() PopFont(); } - if (m_bIsOpen) - PopStyleVar(); - i++; } PopFont(); diff --git a/Amalgam/src/Features/ImGui/Render.cpp b/Amalgam/src/Features/ImGui/Render.cpp index b86d2675..22ee7c40 100644 --- a/Amalgam/src/Features/ImGui/Render.cpp +++ b/Amalgam/src/Features/ImGui/Render.cpp @@ -55,13 +55,12 @@ void CRender::LoadColors() }; Accent = ColorToVec(Vars::Menu::Theme::Accent.Value); - AccentL = ImColor(Accent.Value.x * 1.1f, Accent.Value.y * 1.1f, Accent.Value.z * 1.1f, Accent.Value.w); Background0 = ColorToVec(Vars::Menu::Theme::Background.Value); - Background0p5 = ColorToVec(Vars::Menu::Theme::Background.Value.Lerp({ 127, 127, 127, Vars::Menu::Theme::Background.Value.a }, 0.5f / 9)); - Background1 = ColorToVec(Vars::Menu::Theme::Background.Value.Lerp({ 127, 127, 127, Vars::Menu::Theme::Background.Value.a }, 1.f / 9)); - Background1p5 = ColorToVec(Vars::Menu::Theme::Background.Value.Lerp({ 127, 127, 127, Vars::Menu::Theme::Background.Value.a }, 1.5f / 9)); - Background1p5L = ImColor(Background1p5.Value.x * 1.1f, Background1p5.Value.y * 1.1f, Background1p5.Value.z * 1.1f, Background1p5.Value.w); - Background2 = ColorToVec(Vars::Menu::Theme::Background.Value.Lerp({ 127, 127, 127, Vars::Menu::Theme::Background.Value.a }, 2.f / 9)); + Background0p5 = ColorToVec(Vars::Menu::Theme::Background.Value.Lerp({ 127, 127, 127 }, 0.5f / 9, LerpEnum::NoAlpha)); + Background1 = ColorToVec(Vars::Menu::Theme::Background.Value.Lerp({ 127, 127, 127 }, 1.f / 9, LerpEnum::NoAlpha)); + Background1p5 = ColorToVec(Vars::Menu::Theme::Background.Value.Lerp({ 127, 127, 127 }, 1.5f / 9, LerpEnum::NoAlpha)); + Background1p5L = { Background1p5.Value.x * 1.1f, Background1p5.Value.y * 1.1f, Background1p5.Value.z * 1.1f, Background1p5.Value.w }; + Background2 = ColorToVec(Vars::Menu::Theme::Background.Value.Lerp({ 127, 127, 127 }, 2.f / 9, LerpEnum::NoAlpha)); Inactive = ColorToVec(Vars::Menu::Theme::Inactive.Value); Active = ColorToVec(Vars::Menu::Theme::Active.Value); @@ -82,8 +81,6 @@ void CRender::LoadColors() colors[ImGuiCol_ResizeGripActive] = {}; colors[ImGuiCol_ResizeGripHovered] = {}; colors[ImGuiCol_ScrollbarBg] = {}; - colors[ImGuiCol_SliderGrab] = Accent; - colors[ImGuiCol_SliderGrabActive] = AccentL; colors[ImGuiCol_Text] = Active; colors[ImGuiCol_WindowBg] = {}; } diff --git a/Amalgam/src/Features/ImGui/Render.h b/Amalgam/src/Features/ImGui/Render.h index ab625052..0b68be28 100644 --- a/Amalgam/src/Features/ImGui/Render.h +++ b/Amalgam/src/Features/ImGui/Render.h @@ -17,7 +17,6 @@ public: // Colors ImColor Accent = {}; - ImColor AccentL = {}; ImColor Background0 = {}; ImColor Background0p5 = {}; ImColor Background1 = {}; diff --git a/Amalgam/src/Features/Misc/Misc.cpp b/Amalgam/src/Features/Misc/Misc.cpp index 320f1273..cd5b36e0 100644 --- a/Amalgam/src/Features/Misc/Misc.cpp +++ b/Amalgam/src/Features/Misc/Misc.cpp @@ -401,11 +401,11 @@ void CMisc::FastMovement(CTFPlayer* pLocal, CUserCmd* pCmd) if (!Vars::Misc::Movement::FastStop.Value || !flSpeed) return; - Vec3 direction = pLocal->m_vecVelocity().toAngle(); - direction.y = pCmd->viewangles.y - direction.y; - const Vec3 negatedDirection = direction.fromAngle() * -flSpeed; - pCmd->forwardmove = negatedDirection.x; - pCmd->sidemove = negatedDirection.y; + Vec3 vDirection = pLocal->m_vecVelocity().ToAngle(); + vDirection.y = pCmd->viewangles.y - vDirection.y; + Vec3 vNegatedDirection = vDirection.FromAngle() * -flSpeed; + pCmd->forwardmove = vNegatedDirection.x; + pCmd->sidemove = vNegatedDirection.y; break; } @@ -419,13 +419,12 @@ void CMisc::FastMovement(CTFPlayer* pLocal, CUserCmd* pCmd) if (!(pCmd->buttons & (IN_FORWARD | IN_BACK | IN_MOVELEFT | IN_MOVERIGHT))) return; - const Vec3 vecMove(pCmd->forwardmove, pCmd->sidemove, 0.f); - const float flLength = vecMove.Length(); - Vec3 angMoveReverse; - Math::VectorAngles(vecMove * -1.f, angMoveReverse); + Vec3 vMove = { pCmd->forwardmove, pCmd->sidemove, 0.f }; + float flLength = vMove.Length(); + Vec3 vAngMoveReverse; Math::VectorAngles(vMove * -1.f, vAngMoveReverse); pCmd->forwardmove = -flLength; pCmd->sidemove = 0.f; - pCmd->viewangles.y = fmodf(pCmd->viewangles.y - angMoveReverse.y, 360.f); + pCmd->viewangles.y = fmodf(pCmd->viewangles.y - vAngMoveReverse.y, 360.f); pCmd->viewangles.z = 270.f; G::PSilentAngles = true; diff --git a/Amalgam/src/Features/Visuals/Chams/Chams.cpp b/Amalgam/src/Features/Visuals/Chams/Chams.cpp index 46eddcab..79622de1 100644 --- a/Amalgam/src/Features/Visuals/Chams/Chams.cpp +++ b/Amalgam/src/Features/Visuals/Chams/Chams.cpp @@ -364,7 +364,8 @@ void CChams::RenderBacktrack(const DrawModelState_t& pState, const ModelRenderIn return; static auto ModelRender_DrawModelExecute = U::Hooks.m_mHooks["IVModelRender_DrawModelExecute"]; - if (!ModelRender_DrawModelExecute) + auto pRenderContext = I::MaterialSystem->GetRenderContext(); + if (!ModelRender_DrawModelExecute || !pRenderContext) return; auto pEntity = I::ClientEntityList->GetClientEntity(pInfo.entity_index)->As(); @@ -373,6 +374,8 @@ void CChams::RenderBacktrack(const DrawModelState_t& pState, const ModelRenderIn + pRenderContext->DepthRange(0.f, Vars::Chams::Backtrack::IgnoreZ.Value ? 0.2f : 1.f); + auto drawModel = [&](Vec3& vOrigin, const DrawModelState_t& pState, const ModelRenderInfo_t& pInfo, matrix3x4* pBoneToWorld) { if (!SDK::IsOnScreen(pEntity, vOrigin)) @@ -416,6 +419,8 @@ void CChams::RenderBacktrack(const DrawModelState_t& pState, const ModelRenderIn } } } + + pRenderContext->DepthRange(0.f, 1.f); } void CChams::RenderFakeAngle(const DrawModelState_t& pState, const ModelRenderInfo_t& pInfo) { @@ -423,12 +428,17 @@ void CChams::RenderFakeAngle(const DrawModelState_t& pState, const ModelRenderIn return; static auto ModelRender_DrawModelExecute = U::Hooks.m_mHooks["IVModelRender_DrawModelExecute"]; - if (!ModelRender_DrawModelExecute) + auto pRenderContext = I::MaterialSystem->GetRenderContext(); + if (!ModelRender_DrawModelExecute || !pRenderContext) return; + pRenderContext->DepthRange(0.f, Vars::Chams::FakeAngle::IgnoreZ.Value ? 0.2f : 1.f); + ModelRender_DrawModelExecute->Call(I::ModelRender, pState, pInfo, F::FakeAngle.aBones); + + pRenderContext->DepthRange(0.f, 1.f); } void CChams::RenderHandler(const DrawModelState_t& pState, const ModelRenderInfo_t& pInfo, matrix3x4* pBoneToWorld) { diff --git a/Amalgam/src/Features/Visuals/Glow/Glow.cpp b/Amalgam/src/Features/Visuals/Glow/Glow.cpp index 262fe4f4..163dcac9 100644 --- a/Amalgam/src/Features/Visuals/Glow/Glow.cpp +++ b/Amalgam/src/Features/Visuals/Glow/Glow.cpp @@ -352,7 +352,7 @@ void CGlow::Store(CTFPlayer* pLocal) if (bShowFriendly && pEntity->m_iTeamNum() == pLocal->m_iTeamNum() || bShowEnemy && pEntity->m_iTeamNum() != pLocal->m_iTeamNum()) { tGlow = Glow_t(Vars::Glow::Backtrack::Stencil.Value, Vars::Glow::Backtrack::Blur.Value); - mvEntities[tGlow].emplace_back(pEntity, tColor, true); + mvEntities[tGlow].emplace_back(pEntity, Vars::Colors::Backtrack.Value.a ? Vars::Colors::Backtrack.Value : tColor, true); } } } @@ -361,7 +361,7 @@ void CGlow::Store(CTFPlayer* pLocal) if (Vars::Glow::FakeAngle::Enabled.Value && (Vars::Glow::FakeAngle::Stencil.Value || Vars::Glow::FakeAngle::Blur.Value) && pEntity == pLocal && F::FakeAngle.bDrawChams && F::FakeAngle.bBonesSetup) { tGlow = Glow_t(Vars::Glow::FakeAngle::Stencil.Value, Vars::Glow::FakeAngle::Blur.Value); - mvEntities[tGlow].emplace_back(pEntity, tColor, true); + mvEntities[tGlow].emplace_back(pEntity, Vars::Colors::FakeAngle.Value.a ? Vars::Colors::FakeAngle.Value : tColor, true); } } } diff --git a/Amalgam/src/Features/Visuals/Materials/Materials.cpp b/Amalgam/src/Features/Visuals/Materials/Materials.cpp index 37befcaf..60d612f7 100644 --- a/Amalgam/src/Features/Visuals/Materials/Materials.cpp +++ b/Amalgam/src/Features/Visuals/Materials/Materials.cpp @@ -18,9 +18,8 @@ void CMaterials::Remove(IMaterial* pMaterial) if (!pMaterial) return; - auto it = m_mMatList.find(pMaterial); - if (it != m_mMatList.end()) - m_mMatList.erase(it); + if (m_mMatList.contains(pMaterial)) + m_mMatList.erase(pMaterial); pMaterial->DecrementReferenceCount(); pMaterial->DeleteIfUnreferenced(); @@ -39,7 +38,7 @@ void CMaterials::StoreStruct(std::string sName, std::string sVMT, bool bLocked) m_mMaterials[FNV1A::Hash32(sName.c_str())] = tMaterial; } -void CMaterials::StoreVars(Material_t& tMaterial) +static inline void StoreVars(Material_t& tMaterial) { if (tMaterial.m_bStored || !tMaterial.m_pMaterial) return; @@ -59,6 +58,14 @@ void CMaterials::StoreVars(Material_t& tMaterial) tMaterial.m_bInvertCull = true; } +static inline void RemoveVars(Material_t& tMaterial) +{ + tMaterial.m_bStored = false; + tMaterial.m_phongtint = nullptr; + tMaterial.m_envmaptint = nullptr; + tMaterial.m_bInvertCull = false; +} + static inline void ModifyKeyValues(KeyValues* pKV) { pKV->SetString("$model", "1"); // prevent wacko chams @@ -206,6 +213,8 @@ void CMaterials::ReloadMaterials() LoadMaterials(); } + + void CMaterials::SetColor(Material_t* pMaterial, Color_t tColor) { float r = float(tColor.r) / 255.f; @@ -238,9 +247,8 @@ Material_t* CMaterials::GetMaterial(uint32_t uHash) std::string CMaterials::GetVMT(uint32_t uHash) { - const auto cham = m_mMaterials.find(uHash); - if (cham != m_mMaterials.end()) - return cham->second.m_sVMT; + if (m_mMaterials.contains(uHash)) + return m_mMaterials[uHash].m_sVMT; return ""; } @@ -248,7 +256,7 @@ std::string CMaterials::GetVMT(uint32_t uHash) void CMaterials::AddMaterial(const char* sName) { auto uHash = FNV1A::Hash32(sName); - if (uHash == FNV1A::Hash32Const("Original") || std::filesystem::exists(F::Configs.m_sMaterialsPath + sName) || m_mMaterials.contains(uHash)) + if (uHash == FNV1A::Hash32Const("Original") || std::filesystem::exists(F::Configs.m_sMaterialsPath + sName + ".vmt") || m_mMaterials.contains(uHash)) return; StoreStruct( @@ -265,26 +273,27 @@ void CMaterials::AddMaterial(const char* sName) ModifyKeyValues(kv); tMaterial.m_pMaterial = Create(sName, kv); - StoreVars(tMaterial); + //StoreVars(tMaterial); - std::ofstream outStream(F::Configs.m_sMaterialsPath + sName); + std::ofstream outStream(F::Configs.m_sMaterialsPath + sName + ".vmt"); outStream << tMaterial.m_sVMT; outStream.close(); } void CMaterials::EditMaterial(const char* sName, const char* sVMT) { - if (!std::filesystem::exists(F::Configs.m_sMaterialsPath + sName)) + if (!std::filesystem::exists(F::Configs.m_sMaterialsPath + sName + ".vmt")) return; m_bLoaded = false; - const auto cham = m_mMaterials.find(FNV1A::Hash32(sName)); - if (cham != m_mMaterials.end() && !cham->second.m_bLocked) + auto uHash = FNV1A::Hash32(sName); + if (m_mMaterials.contains(uHash) && !m_mMaterials[uHash].m_bLocked) { - auto& tMaterial = cham->second; + auto& tMaterial = m_mMaterials[uHash]; Remove(tMaterial.m_pMaterial); + RemoveVars(tMaterial); tMaterial.m_sVMT = sVMT; KeyValues* kv = new KeyValues(sName); @@ -292,9 +301,9 @@ void CMaterials::EditMaterial(const char* sName, const char* sVMT) ModifyKeyValues(kv); tMaterial.m_pMaterial = Create(sName, kv); - StoreVars(tMaterial); + //StoreVars(tMaterial); - std::ofstream outStream(F::Configs.m_sMaterialsPath + sName); + std::ofstream outStream(F::Configs.m_sMaterialsPath + sName + ".vmt"); outStream << sVMT; outStream.close(); } @@ -304,18 +313,16 @@ void CMaterials::EditMaterial(const char* sName, const char* sVMT) void CMaterials::RemoveMaterial(const char* sName) { - if (!std::filesystem::exists(F::Configs.m_sMaterialsPath + sName)) + if (!std::filesystem::exists(F::Configs.m_sMaterialsPath + sName + ".vmt")) return; m_bLoaded = false; auto uHash = FNV1A::Hash32(sName); - const auto cham = m_mMaterials.find(uHash); - if (cham != m_mMaterials.end() && !cham->second.m_bLocked) + if (m_mMaterials.contains(uHash) && !m_mMaterials[uHash].m_bLocked) { - Remove(cham->second.m_pMaterial); - - m_mMaterials.erase(cham); + Remove(m_mMaterials[uHash].m_pMaterial); + m_mMaterials.erase(uHash); std::filesystem::remove(F::Configs.m_sMaterialsPath + sName + ".vmt"); diff --git a/Amalgam/src/Features/Visuals/Materials/Materials.h b/Amalgam/src/Features/Visuals/Materials/Materials.h index 34d230c4..ec2f53b5 100644 --- a/Amalgam/src/Features/Visuals/Materials/Materials.h +++ b/Amalgam/src/Features/Visuals/Materials/Materials.h @@ -23,19 +23,17 @@ public: void ReloadMaterials(); IMaterial* Create(char const* szName, KeyValues* pKV); - void StoreStruct(std::string sName, std::string sVMT, bool bLocked = false); - void StoreVars(Material_t& tMaterial); void Remove(IMaterial* pMaterial); + void StoreStruct(std::string sName, std::string sVMT, bool bLocked = false); + + void SetColor(Material_t* pMaterial, Color_t tColor); Material_t* GetMaterial(uint32_t uHash); std::string GetVMT(uint32_t uHash); - void AddMaterial(const char* sName); void EditMaterial(const char* sName, const char* sVMT); void RemoveMaterial(const char* sName); - void SetColor(Material_t* pMaterial, Color_t tColor); - std::unordered_map m_mMaterials; std::unordered_map m_mMatList; diff --git a/Amalgam/src/Features/Visuals/Notifications/Notifications.cpp b/Amalgam/src/Features/Visuals/Notifications/Notifications.cpp index 7dd5535a..878aa771 100644 --- a/Amalgam/src/Features/Visuals/Notifications/Notifications.cpp +++ b/Amalgam/src/Features/Visuals/Notifications/Notifications.cpp @@ -47,11 +47,10 @@ void CNotifications::Draw() } } - auto& cAccent = tNotification.m_tAccent, &cBackground = tNotification.m_tBackground, &cActive = tNotification.m_tActive; - H::Draw.GradientRect(x + 1, y + 1, w - 2, h - 2, { cBackground.r, cBackground.g, cBackground.b, 255 }, { cBackground.r, cBackground.g, cBackground.b, 127 }, true); - H::Draw.FillRect(x + 1, y + 1, H::Draw.Scale(2, Scale_Round), h - 2, { cAccent.r, cAccent.g, cAccent.b, 255 }); - H::Draw.LineRect(x, y, w, h, { cBackground.r, cBackground.g, cBackground.b, 255 }); - H::Draw.StringOutlined(fFont, x + H::Draw.Scale(13, Scale_Round), y + H::Draw.Scale(9, Scale_Round), { cActive.r, cActive.g, cActive.b, 255 }, Vars::Menu::Theme::Background.Value, ALIGN_TOPLEFT, tNotification.m_sText.c_str()); + H::Draw.GradientRect(x + 1, y + 1, w - 2, h - 2, tNotification.m_tBackground.Alpha(255), tNotification.m_tBackground.Alpha(127), true); + H::Draw.FillRect(x + 1, y + 1, H::Draw.Scale(2, Scale_Round), h - 2, tNotification.m_tAccent.Alpha(255)); + H::Draw.LineRect(x, y, w, h, tNotification.m_tBackground.Alpha(255)); + H::Draw.StringOutlined(fFont, x + H::Draw.Scale(13, Scale_Round), y + H::Draw.Scale(9, Scale_Round), tNotification.m_tActive.Alpha(255), Vars::Menu::Theme::Background.Value, ALIGN_TOPLEFT, tNotification.m_sText.c_str()); y += (h + 8) * (1.f - flEase); } diff --git a/Amalgam/src/Features/Visuals/SpectatorList/SpectatorList.cpp b/Amalgam/src/Features/Visuals/SpectatorList/SpectatorList.cpp index ec9b7d77..17816bcb 100644 --- a/Amalgam/src/Features/Visuals/SpectatorList/SpectatorList.cpp +++ b/Amalgam/src/Features/Visuals/SpectatorList/SpectatorList.cpp @@ -24,9 +24,8 @@ bool CSpectatorList::GetSpectators(CTFPlayer* pTarget) if (pPlayer->IsAlive() || pObserverTarget != pTarget || bLocal && !I::EngineClient->IsPlayingDemo() && F::Spectate.m_iTarget == -1) { - auto it = m_mRespawnCache.find(pPlayer->entindex()); - if (it != m_mRespawnCache.end()) - m_mRespawnCache.erase(it); + if (m_mRespawnCache.contains(pPlayer->entindex())) + m_mRespawnCache.erase(pPlayer->entindex()); continue; } diff --git a/Amalgam/src/Features/Visuals/Visuals.cpp b/Amalgam/src/Features/Visuals/Visuals.cpp index 25f9feb4..b1c2b70e 100644 --- a/Amalgam/src/Features/Visuals/Visuals.cpp +++ b/Amalgam/src/Features/Visuals/Visuals.cpp @@ -284,7 +284,9 @@ void CVisuals::ProjectileTrace(CTFPlayer* pPlayer, CTFWeaponBase* pWeapon, const } else if (Vars::Visuals::Simulation::ShotPath.Value) { + G::BoxStorage.clear(); G::PathStorage.clear(); + if (Vars::Colors::ShotPath.Value.a) G::PathStorage.emplace_back(tProjInfo.m_vPath, -float(tProjInfo.m_vPath.size()) - TIME_TO_TICKS(F::Backtrack.GetReal()), Vars::Colors::ShotPath.Value, Vars::Visuals::Simulation::ShotPath.Value); if (Vars::Colors::ShotPathClipped.Value.a) @@ -296,8 +298,6 @@ void CVisuals::ProjectileTrace(CTFPlayer* pPlayer, CTFWeaponBase* pWeapon, const const Vec3 vSize = { 1.f, flSize, flSize }; Vec3 vAngles; Math::VectorAngles(*pNormal, vAngles); - if (Vars::Colors::ShotPath.Value.a || Vars::Colors::TrajectoryPathClipped.Value.a) - G::BoxStorage.clear(); if (Vars::Colors::ShotPath.Value.a) G::BoxStorage.emplace_back(trace.endpos, vSize * -1, vSize, vAngles, I::GlobalVars->curtime + TICKS_TO_TIME(tProjInfo.m_vPath.size()) + F::Backtrack.GetReal(), Vars::Colors::ShotPath.Value, Color_t(0, 0, 0, 0)); if (Vars::Colors::ShotPathClipped.Value.a) @@ -996,33 +996,39 @@ void CVisuals::OverrideWorldTextures() return; KeyValues* kv = new KeyValues("LightmappedGeneric"); - if (uHash == FNV1A::Hash32Const("Dev")) - kv->SetString("$basetexture", "dev/dev_measuregeneric01b"); - else if (uHash == FNV1A::Hash32Const("Camo")) - kv->SetString("$basetexture", "patterns/paint_strokes"); - else if (uHash == FNV1A::Hash32Const("Black")) - kv->SetString("$basetexture", "patterns/combat/black"); - else if (uHash == FNV1A::Hash32Const("White")) - kv->SetString("$basetexture", "patterns/combat/white"); - else if (uHash == FNV1A::Hash32Const("Flat")) - { - kv->SetString("$basetexture", "vgui/white_additive"); - kv->SetString("$color2", "[0.12 0.12 0.15]"); - } - else - kv->SetString("$basetexture", Vars::Visuals::World::WorldTexture.Value.c_str()); - if (!kv) return; + switch (uHash) + { + case FNV1A::Hash32Const("Dev"): + kv->SetString("$basetexture", "dev/dev_measuregeneric01b"); + break; + case FNV1A::Hash32Const("Camo"): + kv->SetString("$basetexture", "patterns/paint_strokes"); + break; + case FNV1A::Hash32Const("Black"): + kv->SetString("$basetexture", "patterns/combat/black"); + break; + case FNV1A::Hash32Const("White"): + kv->SetString("$basetexture", "patterns/combat/white"); + break; + case FNV1A::Hash32Const("Flat"): + kv->SetString("$basetexture", "vgui/white_additive"); + kv->SetString("$color2", "[0.12 0.12 0.15]"); + break; + default: + kv->SetString("$basetexture", Vars::Visuals::World::WorldTexture.Value.c_str()); + } + for (auto h = I::MaterialSystem->FirstMaterial(); h != I::MaterialSystem->InvalidMaterial(); h = I::MaterialSystem->NextMaterial(h)) { auto pMaterial = I::MaterialSystem->GetMaterial(h); if (!pMaterial || pMaterial->IsErrorMaterial() || !pMaterial->IsPrecached() || pMaterial->IsTranslucent() || pMaterial->IsSpriteCard()) continue; - auto sGroup = std::string_view(pMaterial->GetTextureGroupName()); - auto sName = std::string_view(pMaterial->GetName()); + std::string_view sGroup = pMaterial->GetTextureGroupName(); + std::string_view sName = pMaterial->GetName(); if (!sGroup._Starts_with("World") || sName.find("water") != std::string_view::npos || sName.find("glass") != std::string_view::npos diff --git a/Amalgam/src/Hooks/CAchievementMgr_CheckAchievementsEnabled.cpp b/Amalgam/src/Hooks/CAchievementMgr_CheckAchievementsEnabled.cpp index 492b16dd..44123057 100644 --- a/Amalgam/src/Hooks/CAchievementMgr_CheckAchievementsEnabled.cpp +++ b/Amalgam/src/Hooks/CAchievementMgr_CheckAchievementsEnabled.cpp @@ -6,7 +6,7 @@ MAKE_HOOK(CAchievementMgr_CheckAchievementsEnabled, S::CAchievementMgr_CheckAchi void* rcx) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CAchievementMgr_CheckAchievementsEnabled.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CAchievementMgr_CheckAchievementsEnabled[DEFAULT_BIND]) return CALL_ORIGINAL(rcx); #endif diff --git a/Amalgam/src/Hooks/CAttributeManager_AttribHookValue.cpp b/Amalgam/src/Hooks/CAttributeManager_AttribHookValue.cpp index c6b8923a..f40b5ca9 100644 --- a/Amalgam/src/Hooks/CAttributeManager_AttribHookValue.cpp +++ b/Amalgam/src/Hooks/CAttributeManager_AttribHookValue.cpp @@ -12,7 +12,7 @@ MAKE_HOOK(CAttributeManager_AttribHookInt, S::CAttributeManager_AttribHookInt(), int value, const char* name, void* econent, void* buffer, bool isGlobalConstString) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CAttributeManager_AttribHookValue.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CAttributeManager_AttribHookValue[DEFAULT_BIND]) return CALL_ORIGINAL(value, name, econent, buffer, isGlobalConstString); #endif diff --git a/Amalgam/src/Hooks/CBaseAnimating_Interpolate.cpp b/Amalgam/src/Hooks/CBaseAnimating_Interpolate.cpp index 355268ea..7557b030 100644 --- a/Amalgam/src/Hooks/CBaseAnimating_Interpolate.cpp +++ b/Amalgam/src/Hooks/CBaseAnimating_Interpolate.cpp @@ -9,7 +9,7 @@ MAKE_HOOK(CBaseAnimating_Interpolate, S::CBaseAnimating_Interpolate(), bool, void* rcx, float currentTime) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CBaseAnimating_Interpolate.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CBaseAnimating_Interpolate[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, currentTime); #endif diff --git a/Amalgam/src/Hooks/CBaseAnimating_MaintainSequenceTransitions.cpp b/Amalgam/src/Hooks/CBaseAnimating_MaintainSequenceTransitions.cpp index 879a233c..dd087f15 100644 --- a/Amalgam/src/Hooks/CBaseAnimating_MaintainSequenceTransitions.cpp +++ b/Amalgam/src/Hooks/CBaseAnimating_MaintainSequenceTransitions.cpp @@ -6,7 +6,7 @@ MAKE_HOOK(CBaseAnimating_MaintainSequenceTransitions, S::CBaseAnimating_Maintain void* rcx, void* boneSetup, float flCycle, Vec3 pos[], Vector4D q[]) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CBaseAnimating_MaintainSequenceTransitions.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CBaseAnimating_MaintainSequenceTransitions[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, boneSetup, flCycle, pos, q); #endif } \ No newline at end of file diff --git a/Amalgam/src/Hooks/CBaseAnimating_SetSequence.cpp b/Amalgam/src/Hooks/CBaseAnimating_SetSequence.cpp index 6e80b996..46565d99 100644 --- a/Amalgam/src/Hooks/CBaseAnimating_SetSequence.cpp +++ b/Amalgam/src/Hooks/CBaseAnimating_SetSequence.cpp @@ -6,7 +6,7 @@ MAKE_HOOK(CBaseAnimating_SetSequence, S::CBaseAnimating_SetSequence(), void, void* rcx, int nSequence) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CBaseAnimating_SetSequence.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CBaseAnimating_SetSequence[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, nSequence); #endif diff --git a/Amalgam/src/Hooks/CBaseAnimating_SetupBones.cpp b/Amalgam/src/Hooks/CBaseAnimating_SetupBones.cpp index 27683e2d..94a0fed1 100644 --- a/Amalgam/src/Hooks/CBaseAnimating_SetupBones.cpp +++ b/Amalgam/src/Hooks/CBaseAnimating_SetupBones.cpp @@ -6,7 +6,7 @@ MAKE_HOOK(CBaseAnimating_SetupBones, S::CBaseAnimating_SetupBones(), bool, void* rcx, matrix3x4* pBoneToWorldOut, int nMaxBones, int boneMask, float currentTime) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CBaseAnimating_SetupBones.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CBaseAnimating_SetupBones[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, pBoneToWorldOut, nMaxBones, boneMask, currentTime); #endif diff --git a/Amalgam/src/Hooks/CBaseAnimating_UpdateClientSideAnimation.cpp b/Amalgam/src/Hooks/CBaseAnimating_UpdateClientSideAnimation.cpp index 066d8d78..86d3804c 100644 --- a/Amalgam/src/Hooks/CBaseAnimating_UpdateClientSideAnimation.cpp +++ b/Amalgam/src/Hooks/CBaseAnimating_UpdateClientSideAnimation.cpp @@ -8,7 +8,7 @@ MAKE_HOOK(CBaseAnimating_UpdateClientSideAnimation, S::CBaseAnimating_UpdateClie void* rcx) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CBaseAnimating_UpdateClientSideAnimation.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CBaseAnimating_UpdateClientSideAnimation[DEFAULT_BIND]) return CALL_ORIGINAL(rcx); #endif diff --git a/Amalgam/src/Hooks/CBaseEntity_BaseInterpolatePart1.cpp b/Amalgam/src/Hooks/CBaseEntity_BaseInterpolatePart1.cpp index 4aa57f0f..84f716c6 100644 --- a/Amalgam/src/Hooks/CBaseEntity_BaseInterpolatePart1.cpp +++ b/Amalgam/src/Hooks/CBaseEntity_BaseInterpolatePart1.cpp @@ -8,7 +8,7 @@ MAKE_HOOK(CBaseEntity_BaseInterpolatePart1, S::CBaseEntity_BaseInterpolatePart1( void* rcx, float& currentTime, Vector& oldOrigin, QAngle& oldAngles, Vector& oldVel, int& bNoMoreChanges) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CBaseEntity_BaseInterpolatePart1.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CBaseEntity_BaseInterpolatePart1[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, currentTime, oldOrigin, oldAngles, oldVel, bNoMoreChanges); #endif diff --git a/Amalgam/src/Hooks/CBaseEntity_EstimateAbsVelocity.cpp b/Amalgam/src/Hooks/CBaseEntity_EstimateAbsVelocity.cpp index 6c94ebca..75f4ef95 100644 --- a/Amalgam/src/Hooks/CBaseEntity_EstimateAbsVelocity.cpp +++ b/Amalgam/src/Hooks/CBaseEntity_EstimateAbsVelocity.cpp @@ -7,7 +7,7 @@ MAKE_HOOK(CBaseEntity_EstimateAbsVelocity, S::CBaseEntity_EstimateAbsVelocity(), void* rcx, Vector& vel) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CBaseEntity_EstimateAbsVelocity.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CBaseEntity_EstimateAbsVelocity[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, vel); #endif diff --git a/Amalgam/src/Hooks/CBaseEntity_FireBullets.cpp b/Amalgam/src/Hooks/CBaseEntity_FireBullets.cpp index d850e4a3..f92ff723 100644 --- a/Amalgam/src/Hooks/CBaseEntity_FireBullets.cpp +++ b/Amalgam/src/Hooks/CBaseEntity_FireBullets.cpp @@ -8,7 +8,7 @@ MAKE_HOOK(CBaseEntity_FireBullets, S::CBaseEntity_FireBullets(), void, void* rcx, CBaseCombatWeapon* pWeapon, const FireBulletsInfo_t& info, bool bDoEffects, int nDamageType, int nCustomDamageType) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CBaseEntity_FireBullets.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CBaseEntity_FireBullets[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, pWeapon, info, nDamageType, nDamageType, nCustomDamageType); #endif diff --git a/Amalgam/src/Hooks/CBaseEntity_ResetLatched.cpp b/Amalgam/src/Hooks/CBaseEntity_ResetLatched.cpp index 6a07934c..d5ce81f4 100644 --- a/Amalgam/src/Hooks/CBaseEntity_ResetLatched.cpp +++ b/Amalgam/src/Hooks/CBaseEntity_ResetLatched.cpp @@ -6,7 +6,7 @@ MAKE_HOOK(CBaseEntity_ResetLatched, S::CBaseEntity_ResetLatched(), void, void* rcx) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CBaseEntity_ResetLatched.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CBaseEntity_ResetLatched[DEFAULT_BIND]) return CALL_ORIGINAL(rcx); #endif diff --git a/Amalgam/src/Hooks/CBaseEntity_SetAbsVelocity.cpp b/Amalgam/src/Hooks/CBaseEntity_SetAbsVelocity.cpp index 89a575d6..de38dfa6 100644 --- a/Amalgam/src/Hooks/CBaseEntity_SetAbsVelocity.cpp +++ b/Amalgam/src/Hooks/CBaseEntity_SetAbsVelocity.cpp @@ -58,7 +58,7 @@ MAKE_HOOK(CBaseEntity_SetAbsVelocity, S::CBaseEntity_SetAbsVelocity(), void, void* rcx, const Vec3& vecAbsVelocity) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CBaseEntity_SetAbsVelocity.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CBaseEntity_SetAbsVelocity[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, vecAbsVelocity); #endif diff --git a/Amalgam/src/Hooks/CBaseEntity_WorldSpaceCenter.cpp b/Amalgam/src/Hooks/CBaseEntity_WorldSpaceCenter.cpp index 0a5dc003..dd19e71f 100644 --- a/Amalgam/src/Hooks/CBaseEntity_WorldSpaceCenter.cpp +++ b/Amalgam/src/Hooks/CBaseEntity_WorldSpaceCenter.cpp @@ -8,7 +8,7 @@ MAKE_HOOK(CBaseEntity_WorldSpaceCenter, S::CBaseEntity_WorldSpaceCenter(), const void* rcx) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CBaseEntity_WorldSpaceCenter.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CBaseEntity_WorldSpaceCenter[DEFAULT_BIND]) return CALL_ORIGINAL(rcx); #endif diff --git a/Amalgam/src/Hooks/CBaseHudChatLine_InsertAndColorizeText.cpp b/Amalgam/src/Hooks/CBaseHudChatLine_InsertAndColorizeText.cpp index dd12282d..1e3dd1a3 100644 --- a/Amalgam/src/Hooks/CBaseHudChatLine_InsertAndColorizeText.cpp +++ b/Amalgam/src/Hooks/CBaseHudChatLine_InsertAndColorizeText.cpp @@ -8,7 +8,7 @@ MAKE_HOOK(CBaseHudChatLine_InsertAndColorizeText, S::CBaseHudChatLine_InsertAndC void* rcx, wchar_t* buf, int clientIndex) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CBaseHudChatLine_InsertAndColorizeText.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CBaseHudChatLine_InsertAndColorizeText[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, buf, clientIndex); #endif diff --git a/Amalgam/src/Hooks/CBasePlayer_CalcPlayerView.cpp b/Amalgam/src/Hooks/CBasePlayer_CalcPlayerView.cpp index c14dba4f..d10bf873 100644 --- a/Amalgam/src/Hooks/CBasePlayer_CalcPlayerView.cpp +++ b/Amalgam/src/Hooks/CBasePlayer_CalcPlayerView.cpp @@ -6,7 +6,7 @@ MAKE_HOOK(CBasePlayer_CalcPlayerView, S::CBasePlayer_CalcPlayerView(), void, void* rcx, Vector& eyeOrigin, QAngle& eyeAngles, float& fov) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CBasePlayer_CalcPlayerView.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CBasePlayer_CalcPlayerView[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, eyeOrigin, eyeAngles, fov); #endif diff --git a/Amalgam/src/Hooks/CBasePlayer_CalcViewModelView.cpp b/Amalgam/src/Hooks/CBasePlayer_CalcViewModelView.cpp index 7d675f39..bd496300 100644 --- a/Amalgam/src/Hooks/CBasePlayer_CalcViewModelView.cpp +++ b/Amalgam/src/Hooks/CBasePlayer_CalcViewModelView.cpp @@ -6,7 +6,7 @@ MAKE_HOOK(CBasePlayer_CalcViewModelView, S::CBasePlayer_CalcViewModelView(), voi void* rcx, CBaseEntity* pOwner, const Vec3& vEyePosition, Vec3& vEyeAngles) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CBasePlayer_CalcViewModelView.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CBasePlayer_CalcViewModelView[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, pOwner, vEyePosition, vEyeAngles); #endif @@ -67,7 +67,7 @@ MAKE_HOOK(ClientModeTFNormal_GetViewModelFOV, U::Memory.GetVFunc(I::ClientModeSh /*void* rcx*/) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CBasePlayer_CalcViewModelView.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CBasePlayer_CalcViewModelView[DEFAULT_BIND]) return CALL_ORIGINAL(/*rcx*/); #endif diff --git a/Amalgam/src/Hooks/CBasePlayer_ItemPostFrame.cpp b/Amalgam/src/Hooks/CBasePlayer_ItemPostFrame.cpp index 1e234e46..bb1e3181 100644 --- a/Amalgam/src/Hooks/CBasePlayer_ItemPostFrame.cpp +++ b/Amalgam/src/Hooks/CBasePlayer_ItemPostFrame.cpp @@ -70,7 +70,7 @@ MAKE_HOOK(CBasePlayer_ItemPostFrame, S::CBasePlayer_ItemPostFrame(), void, void* rcx) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CBasePlayer_ItemPostFrame.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CBasePlayer_ItemPostFrame[DEFAULT_BIND]) return CALL_ORIGINAL(rcx); #endif diff --git a/Amalgam/src/Hooks/CBaseViewModel_ShouldFlipViewModel.cpp b/Amalgam/src/Hooks/CBaseViewModel_ShouldFlipViewModel.cpp index 71110d42..0823794b 100644 --- a/Amalgam/src/Hooks/CBaseViewModel_ShouldFlipViewModel.cpp +++ b/Amalgam/src/Hooks/CBaseViewModel_ShouldFlipViewModel.cpp @@ -6,7 +6,7 @@ MAKE_HOOK(CBaseViewModel_ShouldFlipViewModel, S::CBaseViewModel_ShouldFlipViewMo void* rcx) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CBaseViewModel_ShouldFlipViewModel.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CBaseViewModel_ShouldFlipViewModel[DEFAULT_BIND]) return CALL_ORIGINAL(rcx); #endif diff --git a/Amalgam/src/Hooks/CClientModeShared_CreateMove.cpp b/Amalgam/src/Hooks/CClientModeShared_CreateMove.cpp index 2ce0966f..c962f0dc 100644 --- a/Amalgam/src/Hooks/CClientModeShared_CreateMove.cpp +++ b/Amalgam/src/Hooks/CClientModeShared_CreateMove.cpp @@ -33,7 +33,7 @@ MAKE_HOOK(CClientModeShared_CreateMove, U::Memory.GetVFunc(I::ClientModeShared, CClientModeShared* rcx, float flInputSampleTime, CUserCmd* pCmd) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CClientModeShared_CreateMove.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CClientModeShared_CreateMove[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, flInputSampleTime, pCmd); #endif diff --git a/Amalgam/src/Hooks/CClientModeShared_DoPostScreenSpaceEffects.cpp b/Amalgam/src/Hooks/CClientModeShared_DoPostScreenSpaceEffects.cpp index 32328bd9..b7d9cb45 100644 --- a/Amalgam/src/Hooks/CClientModeShared_DoPostScreenSpaceEffects.cpp +++ b/Amalgam/src/Hooks/CClientModeShared_DoPostScreenSpaceEffects.cpp @@ -9,7 +9,7 @@ MAKE_HOOK(CClientModeShared_DoPostScreenSpaceEffects, U::Memory.GetVFunc(I::Clie void* rcx, const CViewSetup* pSetup) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CClientModeShared_DoPostScreenSpaceEffects.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CClientModeShared_DoPostScreenSpaceEffects[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, pSetup); #endif diff --git a/Amalgam/src/Hooks/CClientModeShared_OverrideView.cpp b/Amalgam/src/Hooks/CClientModeShared_OverrideView.cpp index 5ef2d681..d177ccc0 100644 --- a/Amalgam/src/Hooks/CClientModeShared_OverrideView.cpp +++ b/Amalgam/src/Hooks/CClientModeShared_OverrideView.cpp @@ -6,7 +6,7 @@ MAKE_HOOK(CClientModeShared_OverrideView, U::Memory.GetVFunc(I::ClientModeShared void* rcx, CViewSetup* pView) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CClientModeShared_OverrideView.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CClientModeShared_OverrideView[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, pView); #endif diff --git a/Amalgam/src/Hooks/CClientModeShared_ShouldDrawViewModel.cpp b/Amalgam/src/Hooks/CClientModeShared_ShouldDrawViewModel.cpp index f01ec5d7..3ba0035f 100644 --- a/Amalgam/src/Hooks/CClientModeShared_ShouldDrawViewModel.cpp +++ b/Amalgam/src/Hooks/CClientModeShared_ShouldDrawViewModel.cpp @@ -6,7 +6,7 @@ MAKE_HOOK(CClientModeShared_ShouldDrawViewModel, U::Memory.GetVFunc(I::ClientMod void* rcx) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CClientModeShared_ShouldDrawViewModel.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CClientModeShared_ShouldDrawViewModel[DEFAULT_BIND]) return CALL_ORIGINAL(rcx); #endif diff --git a/Amalgam/src/Hooks/CClientState_GetClientInterpAmount.cpp b/Amalgam/src/Hooks/CClientState_GetClientInterpAmount.cpp index 790a8a8e..ba79c6ca 100644 --- a/Amalgam/src/Hooks/CClientState_GetClientInterpAmount.cpp +++ b/Amalgam/src/Hooks/CClientState_GetClientInterpAmount.cpp @@ -6,7 +6,7 @@ MAKE_HOOK(CClientState_GetClientInterpAmount, S::CClientState_GetClientInterpAmo CClientState* rcx) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CClientState_GetClientInterpAmount.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CClientState_GetClientInterpAmount[DEFAULT_BIND]) return CALL_ORIGINAL(rcx); #endif diff --git a/Amalgam/src/Hooks/CClientState_ProcessFixAngle.cpp b/Amalgam/src/Hooks/CClientState_ProcessFixAngle.cpp index 21b28aa0..82bae4a0 100644 --- a/Amalgam/src/Hooks/CClientState_ProcessFixAngle.cpp +++ b/Amalgam/src/Hooks/CClientState_ProcessFixAngle.cpp @@ -7,7 +7,7 @@ MAKE_HOOK(CClientState_ProcessFixAngle, S::CClientState_ProcessFixAngle(), bool, CClientState* rcx, SVC_FixAngle* msg) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CClientState_ProcessFixAngle.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CClientState_ProcessFixAngle[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, msg); #endif diff --git a/Amalgam/src/Hooks/CHudCrosshair_GetDrawPosition.cpp b/Amalgam/src/Hooks/CHudCrosshair_GetDrawPosition.cpp index 0ca766c7..9dc59d4c 100644 --- a/Amalgam/src/Hooks/CHudCrosshair_GetDrawPosition.cpp +++ b/Amalgam/src/Hooks/CHudCrosshair_GetDrawPosition.cpp @@ -6,7 +6,7 @@ MAKE_HOOK(CHudCrosshair_GetDrawPosition, S::CHudCrosshair_GetDrawPosition(), voi float* pX, float* pY, bool* pbBehindCamera, Vec3 angleCrosshairOffset) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CHudCrosshair_GetDrawPosition.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CHudCrosshair_GetDrawPosition[DEFAULT_BIND]) return CALL_ORIGINAL(pX, pY, pbBehindCamera, angleCrosshairOffset); #endif diff --git a/Amalgam/src/Hooks/CInventoryManager_ShowItemsPickedUp.cpp b/Amalgam/src/Hooks/CInventoryManager_ShowItemsPickedUp.cpp index 3ab2d869..9547d3d9 100644 --- a/Amalgam/src/Hooks/CInventoryManager_ShowItemsPickedUp.cpp +++ b/Amalgam/src/Hooks/CInventoryManager_ShowItemsPickedUp.cpp @@ -6,7 +6,7 @@ MAKE_HOOK(CInventoryManager_ShowItemsPickedUp, S::CInventoryManager_ShowItemsPic void* rcx, bool bForce, bool bReturnToGame, bool bNoPanel) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CInventoryManager_ShowItemsPickedUp.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CInventoryManager_ShowItemsPickedUp[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, bForce, bReturnToGame, bNoPanel); #endif diff --git a/Amalgam/src/Hooks/CL_CheckForPureServerWhitelist.cpp b/Amalgam/src/Hooks/CL_CheckForPureServerWhitelist.cpp index 0b738c68..5715816a 100644 --- a/Amalgam/src/Hooks/CL_CheckForPureServerWhitelist.cpp +++ b/Amalgam/src/Hooks/CL_CheckForPureServerWhitelist.cpp @@ -6,7 +6,7 @@ MAKE_HOOK(CL_CheckForPureServerWhitelist, S::CL_CheckForPureServerWhitelist(), v void **pFilesToReload) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CL_CheckForPureServerWhitelist.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CL_CheckForPureServerWhitelist[DEFAULT_BIND]) return CALL_ORIGINAL(pFilesToReload); #endif diff --git a/Amalgam/src/Hooks/CL_Move.cpp b/Amalgam/src/Hooks/CL_Move.cpp index b93eb0cf..98dfc639 100644 --- a/Amalgam/src/Hooks/CL_Move.cpp +++ b/Amalgam/src/Hooks/CL_Move.cpp @@ -12,7 +12,7 @@ MAKE_HOOK(CL_Move, S::CL_Move(), void, float accumulated_extra_samples, bool bFinalTick) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CL_Move.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CL_Move[DEFAULT_BIND]) return CALL_ORIGINAL(accumulated_extra_samples, bFinalTick); #endif diff --git a/Amalgam/src/Hooks/CL_ProcessPacketEntities.cpp b/Amalgam/src/Hooks/CL_ProcessPacketEntities.cpp index 4f67900b..6e6149f3 100644 --- a/Amalgam/src/Hooks/CL_ProcessPacketEntities.cpp +++ b/Amalgam/src/Hooks/CL_ProcessPacketEntities.cpp @@ -31,7 +31,7 @@ MAKE_HOOK(CL_ProcessPacketEntities, S::CL_ProcessPacketEntities(), bool, SVC_PacketEntities* entmsg) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CL_ProcessPacketEntities.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CL_ProcessPacketEntities[DEFAULT_BIND]) return CALL_ORIGINAL(entmsg); #endif diff --git a/Amalgam/src/Hooks/CL_ReadPackets.cpp b/Amalgam/src/Hooks/CL_ReadPackets.cpp index a8a3adda..5ec3fc68 100644 --- a/Amalgam/src/Hooks/CL_ReadPackets.cpp +++ b/Amalgam/src/Hooks/CL_ReadPackets.cpp @@ -8,7 +8,7 @@ MAKE_HOOK(CL_ReadPackets, S::CL_ReadPackets(), void, bool bFinalTick) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CL_ReadPackets.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CL_ReadPackets[DEFAULT_BIND]) return CALL_ORIGINAL(bFinalTick); #endif diff --git a/Amalgam/src/Hooks/CMatchInviteNotification_OnTick.cpp b/Amalgam/src/Hooks/CMatchInviteNotification_OnTick.cpp index 403f3a79..ccad305e 100644 --- a/Amalgam/src/Hooks/CMatchInviteNotification_OnTick.cpp +++ b/Amalgam/src/Hooks/CMatchInviteNotification_OnTick.cpp @@ -6,7 +6,7 @@ MAKE_HOOK(CMatchInviteNotification_OnTick, S::CMatchInviteNotification_OnTick(), void* rcx) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CMatchInviteNotification_OnTick.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CMatchInviteNotification_OnTick[DEFAULT_BIND]) return CALL_ORIGINAL(rcx); #endif diff --git a/Amalgam/src/Hooks/CMaterial_Uncache.cpp b/Amalgam/src/Hooks/CMaterial_Uncache.cpp index f668f8f0..7fedd28f 100644 --- a/Amalgam/src/Hooks/CMaterial_Uncache.cpp +++ b/Amalgam/src/Hooks/CMaterial_Uncache.cpp @@ -8,7 +8,7 @@ MAKE_HOOK(CMaterial_Uncache, S::CMaterial_Uncache(), void, IMaterial* rcx, bool bPreserveVars) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CMaterial_Uncache.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CMaterial_Uncache[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, bPreserveVars); #endif diff --git a/Amalgam/src/Hooks/CNetChannel_SendDatagram.cpp b/Amalgam/src/Hooks/CNetChannel_SendDatagram.cpp index 4830f9c6..c87983d1 100644 --- a/Amalgam/src/Hooks/CNetChannel_SendDatagram.cpp +++ b/Amalgam/src/Hooks/CNetChannel_SendDatagram.cpp @@ -8,7 +8,7 @@ MAKE_HOOK(CNetChannel_SendDatagram, S::CNetChannel_SendDatagram(), int, CNetChannel* pNetChan, bf_write* datagram) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CNetChannel_SendDatagram.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CNetChannel_SendDatagram[DEFAULT_BIND]) return CALL_ORIGINAL(pNetChan, datagram); #endif diff --git a/Amalgam/src/Hooks/CNetChannel_SendNetMsg.cpp b/Amalgam/src/Hooks/CNetChannel_SendNetMsg.cpp index ea203e07..c2b272ed 100644 --- a/Amalgam/src/Hooks/CNetChannel_SendNetMsg.cpp +++ b/Amalgam/src/Hooks/CNetChannel_SendNetMsg.cpp @@ -10,7 +10,7 @@ MAKE_HOOK(CNetChannel_SendNetMsg, S::CNetChannel_SendNetMsg(), bool, CNetChannel* pNetChan, INetMessage& msg, bool bForceReliable, bool bVoice) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CNetChannel_SendNetMsg.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CNetChannel_SendNetMsg[DEFAULT_BIND]) return CALL_ORIGINAL(pNetChan, msg, bForceReliable, bVoice); #endif diff --git a/Amalgam/src/Hooks/COPRenderSprites_Render.cpp b/Amalgam/src/Hooks/COPRenderSprites_Render.cpp index 41d0cc40..55d21c03 100644 --- a/Amalgam/src/Hooks/COPRenderSprites_Render.cpp +++ b/Amalgam/src/Hooks/COPRenderSprites_Render.cpp @@ -64,7 +64,7 @@ MAKE_HOOK(COPRenderSprites_Render, S::COPRenderSprites_Render(), void, void* rcx, IMatRenderContext* pRenderContext, CParticleCollection* pParticles, void* pContext) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::COPRenderSprites_Render.Map[DEFAULT_BIND]) + if (!Vars::Hooks::COPRenderSprites_Render[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, pRenderContext, pParticles, pContext); #endif @@ -157,7 +157,7 @@ MAKE_HOOK(COPRenderSprites_RenderSpriteCard, S::COPRenderSprites_RenderSpriteCar void* rcx, void* meshBuilder, void* pCtx, SpriteRenderInfo_t& info, int hParticle, void* pSortList, void* pCamera) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::COPRenderSprites_Render.Map[DEFAULT_BIND]) + if (!Vars::Hooks::COPRenderSprites_Render[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, meshBuilder, pCtx, info, hParticle, pSortList, pCamera); #endif @@ -174,7 +174,7 @@ MAKE_HOOK(COPRenderSprites_RenderTwoSequenceSpriteCard, S::COPRenderSprites_Rend void* rcx, void* meshBuilder, void* pCtx, SpriteRenderInfo_t& info, int hParticle, void* pSortList, void* pCamera) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::COPRenderSprites_Render.Map[DEFAULT_BIND]) + if (!Vars::Hooks::COPRenderSprites_Render[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, meshBuilder, pCtx, info, hParticle, pSortList, pCamera); #endif diff --git a/Amalgam/src/Hooks/CParticleProperty_Create.cpp b/Amalgam/src/Hooks/CParticleProperty_Create.cpp index 7cca01c1..2bd48a9c 100644 --- a/Amalgam/src/Hooks/CParticleProperty_Create.cpp +++ b/Amalgam/src/Hooks/CParticleProperty_Create.cpp @@ -10,7 +10,7 @@ MAKE_HOOK(CParticleProperty_CreateName, S::CParticleProperty_CreateName(), void* void* rcx, const char* pszParticleName, ParticleAttachment_t iAttachType, const char* pszAttachmentName) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CParticleProperty_Create.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CParticleProperty_Create[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, pszParticleName, iAttachType, pszAttachmentName); #endif @@ -94,7 +94,7 @@ MAKE_HOOK(CParticleProperty_CreatePoint, S::CParticleProperty_CreatePoint(), voi void* rcx, const char* pszParticleName, ParticleAttachment_t iAttachType, int iAttachmentPoint, Vector vecOriginOffset) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CParticleProperty_Create.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CParticleProperty_Create[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, pszParticleName, iAttachType, iAttachmentPoint, vecOriginOffset); #endif diff --git a/Amalgam/src/Hooks/CPlayerResource_GetPlayerName.cpp b/Amalgam/src/Hooks/CPlayerResource_GetPlayerName.cpp index 02226d37..7ca2533d 100644 --- a/Amalgam/src/Hooks/CPlayerResource_GetPlayerName.cpp +++ b/Amalgam/src/Hooks/CPlayerResource_GetPlayerName.cpp @@ -8,7 +8,7 @@ MAKE_HOOK(CPlayerResource_GetPlayerName, S::CPlayerResource_GetPlayerName(), con void* rcx, int iIndex) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CPlayerResource_GetPlayerName.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CPlayerResource_GetPlayerName[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, iIndex); #endif diff --git a/Amalgam/src/Hooks/CPrediction_RunSimulation.cpp b/Amalgam/src/Hooks/CPrediction_RunSimulation.cpp index 4835f47f..49671865 100644 --- a/Amalgam/src/Hooks/CPrediction_RunSimulation.cpp +++ b/Amalgam/src/Hooks/CPrediction_RunSimulation.cpp @@ -9,7 +9,7 @@ MAKE_HOOK(CPrediction_RunSimulation, S::CPrediction_RunSimulation(), void, void* rcx, int current_command, float curtime, CUserCmd* cmd, CTFPlayer* localPlayer) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CPrediction_RunSimulation.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CPrediction_RunSimulation[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, current_command, curtime, cmd, localPlayer); #endif diff --git a/Amalgam/src/Hooks/CRendering3dView_EnableWorldFog.cpp b/Amalgam/src/Hooks/CRendering3dView_EnableWorldFog.cpp index c2ee7abe..139650f2 100644 --- a/Amalgam/src/Hooks/CRendering3dView_EnableWorldFog.cpp +++ b/Amalgam/src/Hooks/CRendering3dView_EnableWorldFog.cpp @@ -6,7 +6,7 @@ MAKE_HOOK(CRendering3dView_EnableWorldFog, S::CRendering3dView_EnableWorldFog(), ) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CRendering3dView_EnableWorldFog.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CRendering3dView_EnableWorldFog[DEFAULT_BIND]) return CALL_ORIGINAL(); #endif diff --git a/Amalgam/src/Hooks/CSkyboxView_Enable3dSkyboxFog.cpp b/Amalgam/src/Hooks/CSkyboxView_Enable3dSkyboxFog.cpp index 4d0a52c0..e3ebdf7b 100644 --- a/Amalgam/src/Hooks/CSkyboxView_Enable3dSkyboxFog.cpp +++ b/Amalgam/src/Hooks/CSkyboxView_Enable3dSkyboxFog.cpp @@ -6,7 +6,7 @@ MAKE_HOOK(CSkyboxView_Enable3dSkyboxFog, S::CSkyboxView_Enable3dSkyboxFog(), voi void* rcx) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CSkyboxView_Enable3dSkyboxFog.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CSkyboxView_Enable3dSkyboxFog[DEFAULT_BIND]) return CALL_ORIGINAL(rcx); #endif diff --git a/Amalgam/src/Hooks/CSniperDot_GetRenderingPositions.cpp b/Amalgam/src/Hooks/CSniperDot_GetRenderingPositions.cpp index 672e2afe..4b0d2d9e 100644 --- a/Amalgam/src/Hooks/CSniperDot_GetRenderingPositions.cpp +++ b/Amalgam/src/Hooks/CSniperDot_GetRenderingPositions.cpp @@ -13,7 +13,7 @@ MAKE_HOOK(CSniperDot_GetRenderingPositions, S::CSniperDot_GetRenderingPositions( void* rcx, CTFPlayer* pPlayer, Vec3& vecAttachment, Vec3& vecEndPos, float& flSize) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CSniperDot_GetRenderingPositions.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CSniperDot_GetRenderingPositions[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, pPlayer, vecAttachment, vecEndPos, flSize); #endif @@ -32,7 +32,7 @@ MAKE_HOOK(CBasePlayer_EyePosition, S::CBasePlayer_EyePosition(), Vec3*, void* rcx, void* rdx) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CSniperDot_GetRenderingPositions.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CSniperDot_GetRenderingPositions[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, rdx); #endif @@ -48,7 +48,7 @@ MAKE_HOOK(CTFPlayer_EyeAngles, S::CTFPlayer_EyeAngles(), Vec3*, void* rcx) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CSniperDot_GetRenderingPositions.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CSniperDot_GetRenderingPositions[DEFAULT_BIND]) return CALL_ORIGINAL(rcx); #endif diff --git a/Amalgam/src/Hooks/CSoundEmitterSystem_EmitSound.cpp b/Amalgam/src/Hooks/CSoundEmitterSystem_EmitSound.cpp index 08a47483..dcb7e12d 100644 --- a/Amalgam/src/Hooks/CSoundEmitterSystem_EmitSound.cpp +++ b/Amalgam/src/Hooks/CSoundEmitterSystem_EmitSound.cpp @@ -142,7 +142,7 @@ MAKE_HOOK(CSoundEmitterSystem_EmitSound, S::CSoundEmitterSystem_EmitSound(), voi void* rcx, IRecipientFilter& filter, int entindex, const EmitSound_t& ep) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CSoundEmitterSystem_EmitSound.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CSoundEmitterSystem_EmitSound[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, filter, entindex, ep); #endif @@ -157,7 +157,7 @@ MAKE_HOOK(S_StartDynamicSound, S::S_StartDynamicSound(), int, StartSoundParams_t& params) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CSoundEmitterSystem_EmitSound.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CSoundEmitterSystem_EmitSound[DEFAULT_BIND]) return CALL_ORIGINAL(params); #endif @@ -173,7 +173,7 @@ MAKE_HOOK(S_StartSound, S::S_StartSound(), int, StartSoundParams_t& params) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CSoundEmitterSystem_EmitSound.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CSoundEmitterSystem_EmitSound[DEFAULT_BIND]) return CALL_ORIGINAL(params); #endif diff --git a/Amalgam/src/Hooks/CStaticPropMgr_ComputePropOpacity.cpp b/Amalgam/src/Hooks/CStaticPropMgr_ComputePropOpacity.cpp index 1d1beed9..30c08861 100644 --- a/Amalgam/src/Hooks/CStaticPropMgr_ComputePropOpacity.cpp +++ b/Amalgam/src/Hooks/CStaticPropMgr_ComputePropOpacity.cpp @@ -42,7 +42,7 @@ MAKE_HOOK(CStaticPropMgr_ComputePropOpacity, S::CStaticPropMgr_ComputePropOpacit void* rcx, CStaticProp* pProp) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CStaticPropMgr_ComputePropOpacity.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CStaticPropMgr_ComputePropOpacity[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, pProp); #endif diff --git a/Amalgam/src/Hooks/CStaticPropMgr_DrawStaticProps.cpp b/Amalgam/src/Hooks/CStaticPropMgr_DrawStaticProps.cpp index 788dc593..5f7d782d 100644 --- a/Amalgam/src/Hooks/CStaticPropMgr_DrawStaticProps.cpp +++ b/Amalgam/src/Hooks/CStaticPropMgr_DrawStaticProps.cpp @@ -6,7 +6,7 @@ MAKE_HOOK(CStaticPropMgr_DrawStaticProps, S::CStaticPropMgr_DrawStaticProps(), v void* rcx, IClientRenderable** pProps, int count, bool bShadowDepth, bool drawVCollideWireframe) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CStaticPropMgr_DrawStaticProps.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CStaticPropMgr_DrawStaticProps[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, pProps, count, bShadowDepth, drawVCollideWireframe); #endif diff --git a/Amalgam/src/Hooks/CStudioRender_DrawModelStaticProp.cpp b/Amalgam/src/Hooks/CStudioRender_DrawModelStaticProp.cpp index aeb1bc88..791fea5e 100644 --- a/Amalgam/src/Hooks/CStudioRender_DrawModelStaticProp.cpp +++ b/Amalgam/src/Hooks/CStudioRender_DrawModelStaticProp.cpp @@ -4,7 +4,7 @@ MAKE_HOOK(CStudioRender_DrawModelStaticProp, U::Memory.GetVFunc(I::StudioRender, void* rcx, const DrawModelState_t& pState, const matrix3x4& modelToWorld, int flags) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CStudioRender_DrawModelStaticProp.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CStudioRender_DrawModelStaticProp[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, pState, modelToWorld, flags); #endif diff --git a/Amalgam/src/Hooks/CStudioRender_SetAlphaModulation.cpp b/Amalgam/src/Hooks/CStudioRender_SetAlphaModulation.cpp index f7070d4a..8b49182e 100644 --- a/Amalgam/src/Hooks/CStudioRender_SetAlphaModulation.cpp +++ b/Amalgam/src/Hooks/CStudioRender_SetAlphaModulation.cpp @@ -4,7 +4,7 @@ MAKE_HOOK(CStudioRender_SetAlphaModulation, U::Memory.GetVFunc(I::StudioRender, void* rcx, float flAlpha) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CStudioRender_SetAlphaModulation.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CStudioRender_SetAlphaModulation[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, flAlpha); #endif diff --git a/Amalgam/src/Hooks/CStudioRender_SetColorModulation.cpp b/Amalgam/src/Hooks/CStudioRender_SetColorModulation.cpp index b2dd3fa0..de2c755b 100644 --- a/Amalgam/src/Hooks/CStudioRender_SetColorModulation.cpp +++ b/Amalgam/src/Hooks/CStudioRender_SetColorModulation.cpp @@ -4,7 +4,7 @@ MAKE_HOOK(CStudioRender_SetColorModulation, U::Memory.GetVFunc(I::StudioRender, void* rcx, const float* pColor) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CStudioRender_SetColorModulation.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CStudioRender_SetColorModulation[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, pColor); #endif diff --git a/Amalgam/src/Hooks/CTFBadgePanel_SetupBadge.cpp b/Amalgam/src/Hooks/CTFBadgePanel_SetupBadge.cpp index 724eb705..a7c52ff9 100644 --- a/Amalgam/src/Hooks/CTFBadgePanel_SetupBadge.cpp +++ b/Amalgam/src/Hooks/CTFBadgePanel_SetupBadge.cpp @@ -8,7 +8,7 @@ MAKE_HOOK(CTFBadgePanel_SetupBadge, S::CTFBadgePanel_SetupBadge(), void, void* rcx, const IMatchGroupDescription* pMatchDesc, /*const*/ LevelInfo_t& levelInfo, const CSteamID& steamID) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CTFBadgePanel_SetupBadge.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CTFBadgePanel_SetupBadge[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, pMatchDesc, levelInfo, steamID); #endif diff --git a/Amalgam/src/Hooks/CTFClientScoreBoardDialog_UpdatePlayerAvatar.cpp b/Amalgam/src/Hooks/CTFClientScoreBoardDialog_UpdatePlayerAvatar.cpp index bc1e1a11..5d703e62 100644 --- a/Amalgam/src/Hooks/CTFClientScoreBoardDialog_UpdatePlayerAvatar.cpp +++ b/Amalgam/src/Hooks/CTFClientScoreBoardDialog_UpdatePlayerAvatar.cpp @@ -16,7 +16,7 @@ MAKE_HOOK(CTFClientScoreBoardDialog_UpdatePlayerAvatar, S::CTFClientScoreBoardDi void* rcx, int playerIndex, KeyValues* kv) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CTFClientScoreBoardDialog_UpdatePlayerAvatar.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CTFClientScoreBoardDialog_UpdatePlayerAvatar[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, playerIndex, kv); #endif @@ -31,7 +31,7 @@ MAKE_HOOK(CTFMatchSummary_UpdatePlayerAvatar, S::CTFMatchSummary_UpdatePlayerAva void* rcx, int playerIndex, KeyValues* kv) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CTFClientScoreBoardDialog_UpdatePlayerAvatar.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CTFClientScoreBoardDialog_UpdatePlayerAvatar[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, playerIndex, kv); #endif @@ -44,7 +44,7 @@ MAKE_HOOK(CTFHudMannVsMachineScoreboard_UpdatePlayerAvatar, S::CTFHudMannVsMachi void* rcx, int playerIndex, KeyValues* kv) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CTFClientScoreBoardDialog_UpdatePlayerAvatar.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CTFClientScoreBoardDialog_UpdatePlayerAvatar[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, playerIndex, kv); #endif @@ -57,7 +57,7 @@ MAKE_HOOK(CTFHudMatchStatus_UpdatePlayerAvatar, S::CTFHudMatchStatus_UpdatePlaye void* rcx, int playerIndex, KeyValues* kv) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CTFClientScoreBoardDialog_UpdatePlayerAvatar.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CTFClientScoreBoardDialog_UpdatePlayerAvatar[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, playerIndex, kv); #endif @@ -70,7 +70,7 @@ MAKE_HOOK(SectionedListPanel_SetItemFgColor, S::SectionedListPanel_SetItemFgColo void* rcx, int itemID, Color_t color) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CTFClientScoreBoardDialog_UpdatePlayerAvatar.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CTFClientScoreBoardDialog_UpdatePlayerAvatar[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, itemID, color); #endif diff --git a/Amalgam/src/Hooks/CTFGCClientSystem_UpdateAssignedLobby.cpp b/Amalgam/src/Hooks/CTFGCClientSystem_UpdateAssignedLobby.cpp index ed660e2f..1ae9d2b0 100644 --- a/Amalgam/src/Hooks/CTFGCClientSystem_UpdateAssignedLobby.cpp +++ b/Amalgam/src/Hooks/CTFGCClientSystem_UpdateAssignedLobby.cpp @@ -4,7 +4,7 @@ MAKE_HOOK(CTFGCClientSystem_UpdateAssignedLobby, S::CTFGCClientSystem_UpdateAssi void* rcx) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CTFGCClientSystem_UpdateAssignedLobby.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CTFGCClientSystem_UpdateAssignedLobby[DEFAULT_BIND]) return CALL_ORIGINAL(rcx); #endif diff --git a/Amalgam/src/Hooks/CTFHudDeathNotice_AddAdditionalMsg.cpp b/Amalgam/src/Hooks/CTFHudDeathNotice_AddAdditionalMsg.cpp index ee7658c3..1bd1b513 100644 --- a/Amalgam/src/Hooks/CTFHudDeathNotice_AddAdditionalMsg.cpp +++ b/Amalgam/src/Hooks/CTFHudDeathNotice_AddAdditionalMsg.cpp @@ -10,7 +10,7 @@ MAKE_HOOK(CTFHudDeathNotice_AddAdditionalMsg, S::CTFHudDeathNotice_AddAdditional void* rcx, int iKillerID, int iVictimID, const char* pMsgKey) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CTFHudDeathNotice_AddAdditionalMsg.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CTFHudDeathNotice_AddAdditionalMsg[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, iKillerID, iVictimID, pMsgKey); #endif @@ -59,7 +59,7 @@ MAKE_HOOK(CLocalizedStringTable_Find, S::CLocalizedStringTable_Find(), wchar_t*, void* rcx, const char* pName) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CTFHudDeathNotice_AddAdditionalMsg.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CTFHudDeathNotice_AddAdditionalMsg[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, pName); #endif diff --git a/Amalgam/src/Hooks/CTFInput_ApplyMouse.cpp b/Amalgam/src/Hooks/CTFInput_ApplyMouse.cpp index 8d873cdd..82a8e20d 100644 --- a/Amalgam/src/Hooks/CTFInput_ApplyMouse.cpp +++ b/Amalgam/src/Hooks/CTFInput_ApplyMouse.cpp @@ -8,7 +8,7 @@ MAKE_HOOK(CTFInput_ApplyMouse, S::CTFInput_ApplyMouse(), void, void* rcx, QAngle& viewangles, CUserCmd* cmd, float mouse_x, float mouse_y) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CTFInput_ApplyMouse.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CTFInput_ApplyMouse[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, viewangles, cmd, mouse_x, mouse_y); #endif @@ -45,7 +45,7 @@ MAKE_HOOK(CTFInput_CAM_CapYaw, S::CTFInput_CAM_CapYaw(), float, void* rcx, float fVal) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CTFInput_ApplyMouse.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CTFInput_ApplyMouse[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, fVal); #endif diff --git a/Amalgam/src/Hooks/CTFPlayerInventory_GetMaxItemCount.cpp b/Amalgam/src/Hooks/CTFPlayerInventory_GetMaxItemCount.cpp index 91a5134e..8042cf4b 100644 --- a/Amalgam/src/Hooks/CTFPlayerInventory_GetMaxItemCount.cpp +++ b/Amalgam/src/Hooks/CTFPlayerInventory_GetMaxItemCount.cpp @@ -6,7 +6,7 @@ MAKE_HOOK(CTFPlayerInventory_GetMaxItemCount, S::CTFPlayerInventory_GetMaxItemCo void* rcx) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CTFPlayerInventory_GetMaxItemCount.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CTFPlayerInventory_GetMaxItemCount[DEFAULT_BIND]) return CALL_ORIGINAL(rcx); #endif diff --git a/Amalgam/src/Hooks/CTFPlayerPanel_GetTeam.cpp b/Amalgam/src/Hooks/CTFPlayerPanel_GetTeam.cpp index 87c85259..b2a27153 100644 --- a/Amalgam/src/Hooks/CTFPlayerPanel_GetTeam.cpp +++ b/Amalgam/src/Hooks/CTFPlayerPanel_GetTeam.cpp @@ -12,7 +12,7 @@ MAKE_HOOK(CTFPlayerPanel_GetTeam, S::CTFPlayerPanel_GetTeam(), int, void* rcx) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CTFPlayerPanel_GetTeam.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CTFPlayerPanel_GetTeam[DEFAULT_BIND]) return CALL_ORIGINAL(rcx); #endif @@ -34,7 +34,7 @@ MAKE_HOOK(CTFTeamStatusPlayerPanel_Update, S::CTFTeamStatusPlayerPanel_Update(), void* rcx) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CTFPlayerPanel_GetTeam.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CTFPlayerPanel_GetTeam[DEFAULT_BIND]) return CALL_ORIGINAL(rcx); #endif @@ -46,7 +46,7 @@ MAKE_HOOK(vgui_Panel_SetBgColor, S::vgui_Panel_SetBgColor(), void, void* rcx, Color_t color) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CTFPlayerPanel_GetTeam.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CTFPlayerPanel_GetTeam[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, color); #endif diff --git a/Amalgam/src/Hooks/CTFPlayerShared_InCond.cpp b/Amalgam/src/Hooks/CTFPlayerShared_InCond.cpp index 84198c1d..17c21723 100644 --- a/Amalgam/src/Hooks/CTFPlayerShared_InCond.cpp +++ b/Amalgam/src/Hooks/CTFPlayerShared_InCond.cpp @@ -11,7 +11,7 @@ MAKE_HOOK(CTFPlayerShared_InCond, S::CTFPlayerShared_InCond(), bool, void* rcx, ETFCond nCond) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CTFPlayerShared_InCond.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CTFPlayerShared_InCond[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, nCond); #endif diff --git a/Amalgam/src/Hooks/CTFPlayerShared_IsPlayerDominated.cpp b/Amalgam/src/Hooks/CTFPlayerShared_IsPlayerDominated.cpp index de2653ef..111d75b3 100644 --- a/Amalgam/src/Hooks/CTFPlayerShared_IsPlayerDominated.cpp +++ b/Amalgam/src/Hooks/CTFPlayerShared_IsPlayerDominated.cpp @@ -8,7 +8,7 @@ MAKE_HOOK(CTFPlayerShared_IsPlayerDominated, S::CTFPlayerShared_IsPlayerDominate void* rcx, int index) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CTFPlayerShared_IsPlayerDominated.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CTFPlayerShared_IsPlayerDominated[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, index); #endif diff --git a/Amalgam/src/Hooks/CTFPlayer_AvoidPlayers.cpp b/Amalgam/src/Hooks/CTFPlayer_AvoidPlayers.cpp index 05244278..0a532dcd 100644 --- a/Amalgam/src/Hooks/CTFPlayer_AvoidPlayers.cpp +++ b/Amalgam/src/Hooks/CTFPlayer_AvoidPlayers.cpp @@ -6,7 +6,7 @@ MAKE_HOOK(CTFPlayer_AvoidPlayers, S::CTFPlayer_AvoidPlayers(), void, void* rcx, CUserCmd* pCmd) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CTFPlayer_AvoidPlayers.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CTFPlayer_AvoidPlayers[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, pCmd); #endif diff --git a/Amalgam/src/Hooks/CTFPlayer_BRenderAsZombie.cpp b/Amalgam/src/Hooks/CTFPlayer_BRenderAsZombie.cpp index f3aaf77a..34f4582e 100644 --- a/Amalgam/src/Hooks/CTFPlayer_BRenderAsZombie.cpp +++ b/Amalgam/src/Hooks/CTFPlayer_BRenderAsZombie.cpp @@ -7,7 +7,7 @@ MAKE_HOOK(CTFPlayer_BRenderAsZombie, S::CTFPlayer_BRenderAsZombie(), bool, void* rcx, bool bWeaponsCheck) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CTFPlayer_BRenderAsZombie.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CTFPlayer_BRenderAsZombie[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, bWeaponsCheck); #endif diff --git a/Amalgam/src/Hooks/CTFPlayer_BuildTransformations.cpp b/Amalgam/src/Hooks/CTFPlayer_BuildTransformations.cpp index 77a10843..8ec50fd2 100644 --- a/Amalgam/src/Hooks/CTFPlayer_BuildTransformations.cpp +++ b/Amalgam/src/Hooks/CTFPlayer_BuildTransformations.cpp @@ -6,7 +6,7 @@ MAKE_HOOK(CTFPlayer_BuildTransformations, S::CTFPlayer_BuildTransformations(), v void* rcx, CStudioHdr* hdr, Vector* pos, Quaternion q[], const matrix3x4& cameraTransform, int boneMask, void* boneComputed) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CTFPlayer_BuildTransformations.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CTFPlayer_BuildTransformations[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, hdr, pos, q, cameraTransform, boneMask, boneComputed); #endif diff --git a/Amalgam/src/Hooks/CTFPlayer_DoAnimationEvent.cpp b/Amalgam/src/Hooks/CTFPlayer_DoAnimationEvent.cpp index d537f50f..4136ad7e 100644 --- a/Amalgam/src/Hooks/CTFPlayer_DoAnimationEvent.cpp +++ b/Amalgam/src/Hooks/CTFPlayer_DoAnimationEvent.cpp @@ -6,7 +6,7 @@ MAKE_HOOK(CTFPlayer_DoAnimationEvent, S::CTFPlayer_DoAnimationEvent(), void, void* rcx, PlayerAnimEvent_t event, int nData) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CTFPlayer_DoAnimationEvent.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CTFPlayer_DoAnimationEvent[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, event, nData); #endif diff --git a/Amalgam/src/Hooks/CTFPlayer_IsPlayerClass.cpp b/Amalgam/src/Hooks/CTFPlayer_IsPlayerClass.cpp index bcf1bfc2..5b4739dc 100644 --- a/Amalgam/src/Hooks/CTFPlayer_IsPlayerClass.cpp +++ b/Amalgam/src/Hooks/CTFPlayer_IsPlayerClass.cpp @@ -7,7 +7,7 @@ MAKE_HOOK(CTFPlayer_IsPlayerClass, S::CTFPlayer_IsPlayerClass(), bool, void* rcx, int iClass) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CTFPlayer_IsPlayerClass.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CTFPlayer_IsPlayerClass[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, iClass); #endif diff --git a/Amalgam/src/Hooks/CTFPlayer_ShouldDraw.cpp b/Amalgam/src/Hooks/CTFPlayer_ShouldDraw.cpp index 1dec1e06..771a11b6 100644 --- a/Amalgam/src/Hooks/CTFPlayer_ShouldDraw.cpp +++ b/Amalgam/src/Hooks/CTFPlayer_ShouldDraw.cpp @@ -11,7 +11,7 @@ MAKE_HOOK(CTFPlayer_ShouldDraw, S::CTFPlayer_ShouldDraw(), bool, void* rcx) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CTFPlayer_ShouldDraw.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CTFPlayer_ShouldDraw[DEFAULT_BIND]) return CALL_ORIGINAL(rcx); #endif @@ -26,7 +26,7 @@ MAKE_HOOK(CBasePlayer_ShouldDrawThisPlayer, S::CBasePlayer_ShouldDrawThisPlayer( void* rcx) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CTFPlayer_ShouldDraw.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CTFPlayer_ShouldDraw[DEFAULT_BIND]) return CALL_ORIGINAL(rcx); #endif @@ -48,7 +48,7 @@ MAKE_HOOK(CViewRender_DrawViewModels, S::CViewRender_DrawViewModels(), void, void* rcx, const CViewSetup& viewRender, bool drawViewmodel) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CTFPlayer_ShouldDraw.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CTFPlayer_ShouldDraw[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, viewRender, drawViewmodel); #endif diff --git a/Amalgam/src/Hooks/CTFPlayer_UpdateStepSound.cpp b/Amalgam/src/Hooks/CTFPlayer_UpdateStepSound.cpp index 19305b40..0a99ca19 100644 --- a/Amalgam/src/Hooks/CTFPlayer_UpdateStepSound.cpp +++ b/Amalgam/src/Hooks/CTFPlayer_UpdateStepSound.cpp @@ -7,7 +7,7 @@ MAKE_HOOK(CTFPlayer_UpdateStepSound, S::CTFPlayer_UpdateStepSound(), void, void* rcx, void* psurface, const Vec3& vecOrigin, const Vec3& vecVelocity) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CTFPlayer_UpdateStepSound.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CTFPlayer_UpdateStepSound[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, psurface, vecOrigin, vecVelocity); #endif diff --git a/Amalgam/src/Hooks/CTFRagdoll_CreateTFRagdoll.cpp b/Amalgam/src/Hooks/CTFRagdoll_CreateTFRagdoll.cpp index 8097adc8..af36e8b5 100644 --- a/Amalgam/src/Hooks/CTFRagdoll_CreateTFRagdoll.cpp +++ b/Amalgam/src/Hooks/CTFRagdoll_CreateTFRagdoll.cpp @@ -6,7 +6,7 @@ MAKE_HOOK(CTFRagdoll_CreateTFRagdoll, S::CTFRagdoll_CreateTFRagdoll(), void, void* rcx) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CTFRagdoll_CreateTFRagdoll.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CTFRagdoll_CreateTFRagdoll[DEFAULT_BIND]) return CALL_ORIGINAL(rcx); #endif diff --git a/Amalgam/src/Hooks/CTFWeaponBase_CalcIsAttackCritical.cpp b/Amalgam/src/Hooks/CTFWeaponBase_CalcIsAttackCritical.cpp index 520a41ff..49a30aa2 100644 --- a/Amalgam/src/Hooks/CTFWeaponBase_CalcIsAttackCritical.cpp +++ b/Amalgam/src/Hooks/CTFWeaponBase_CalcIsAttackCritical.cpp @@ -7,7 +7,7 @@ MAKE_HOOK(CTFWeaponBase_CalcIsAttackCritical, S::CTFWeaponBase_CalcIsAttackCriti void* rcx) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CTFWeaponBase_CalcIsAttackCritical.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CTFWeaponBase_CalcIsAttackCritical[DEFAULT_BIND]) return CALL_ORIGINAL(rcx); #endif diff --git a/Amalgam/src/Hooks/CTFWeaponBase_GetShootSound.cpp b/Amalgam/src/Hooks/CTFWeaponBase_GetShootSound.cpp index b2f27f60..450a3e88 100644 --- a/Amalgam/src/Hooks/CTFWeaponBase_GetShootSound.cpp +++ b/Amalgam/src/Hooks/CTFWeaponBase_GetShootSound.cpp @@ -6,7 +6,7 @@ MAKE_HOOK(CTFWeaponBase_GetShootSound, S::CTFWeaponBase_GetShootSound(), const c void* rcx, int iIndex) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CTFWeaponBase_GetShootSound.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CTFWeaponBase_GetShootSound[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, iIndex); #endif diff --git a/Amalgam/src/Hooks/CThirdPersonManager_Update.cpp b/Amalgam/src/Hooks/CThirdPersonManager_Update.cpp index ab0e9c7f..6c91ed40 100644 --- a/Amalgam/src/Hooks/CThirdPersonManager_Update.cpp +++ b/Amalgam/src/Hooks/CThirdPersonManager_Update.cpp @@ -6,7 +6,7 @@ MAKE_HOOK(CThirdPersonManager_Update, S::CThirdPersonManager_Update(), void, void* rcx) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CThirdPersonManager_Update.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CThirdPersonManager_Update[DEFAULT_BIND]) return CALL_ORIGINAL(rcx); #endif } \ No newline at end of file diff --git a/Amalgam/src/Hooks/CViewRender_DrawUnderwaterOverlay.cpp b/Amalgam/src/Hooks/CViewRender_DrawUnderwaterOverlay.cpp index 05e7e296..b13ac254 100644 --- a/Amalgam/src/Hooks/CViewRender_DrawUnderwaterOverlay.cpp +++ b/Amalgam/src/Hooks/CViewRender_DrawUnderwaterOverlay.cpp @@ -6,7 +6,7 @@ MAKE_HOOK(CViewRender_DrawUnderwaterOverlay, S::CViewRender_DrawUnderwaterOverla void* rcx) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CViewRender_DrawUnderwaterOverlay.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CViewRender_DrawUnderwaterOverlay[DEFAULT_BIND]) return CALL_ORIGINAL(rcx); #endif diff --git a/Amalgam/src/Hooks/CViewRender_LevelInit.cpp b/Amalgam/src/Hooks/CViewRender_LevelInit.cpp index d9eab70e..3547b15e 100644 --- a/Amalgam/src/Hooks/CViewRender_LevelInit.cpp +++ b/Amalgam/src/Hooks/CViewRender_LevelInit.cpp @@ -12,7 +12,7 @@ MAKE_HOOK(CViewRender_LevelInit, U::Memory.GetVFunc(I::ViewRender, 1), void, void* rcx) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CViewRender_LevelInit.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CViewRender_LevelInit[DEFAULT_BIND]) return CALL_ORIGINAL(rcx); #endif diff --git a/Amalgam/src/Hooks/CViewRender_PerformScreenOverlay.cpp b/Amalgam/src/Hooks/CViewRender_PerformScreenOverlay.cpp index c9e6faf7..0f824f06 100644 --- a/Amalgam/src/Hooks/CViewRender_PerformScreenOverlay.cpp +++ b/Amalgam/src/Hooks/CViewRender_PerformScreenOverlay.cpp @@ -6,7 +6,7 @@ MAKE_HOOK(CViewRender_PerformScreenOverlay, S::CViewRender_PerformScreenOverlay( void* rcx, int x, int y, int w, int h) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CViewRender_PerformScreenOverlay.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CViewRender_PerformScreenOverlay[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, x, y, w, h); #endif diff --git a/Amalgam/src/Hooks/CViewRender_RenderView.cpp b/Amalgam/src/Hooks/CViewRender_RenderView.cpp index 14eca0c3..17109e9a 100644 --- a/Amalgam/src/Hooks/CViewRender_RenderView.cpp +++ b/Amalgam/src/Hooks/CViewRender_RenderView.cpp @@ -6,7 +6,7 @@ MAKE_HOOK(CViewRender_RenderView, U::Memory.GetVFunc(I::ViewRender, 6), void, void* rcx, const CViewSetup& view, ClearFlags_t nClearFlags, RenderViewInfo_t whatToDraw) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::CViewRender_RenderView.Map[DEFAULT_BIND]) + if (!Vars::Hooks::CViewRender_RenderView[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, view, nClearFlags, whatToDraw); #endif diff --git a/Amalgam/src/Hooks/Cbuf_ExecuteCommand.cpp b/Amalgam/src/Hooks/Cbuf_ExecuteCommand.cpp index c891cf61..f81c5bbd 100644 --- a/Amalgam/src/Hooks/Cbuf_ExecuteCommand.cpp +++ b/Amalgam/src/Hooks/Cbuf_ExecuteCommand.cpp @@ -113,7 +113,7 @@ static std::vector> vDynamic = { }, [&]() { - auto sRegex = R"(\\\{rgb:(\d+),(\d+),(\d+)\})"; + auto sRegex = R"(\\\{rgb:(\d+)?(?:,(\d+))?(?:,(\d+))?\})"; while (true) { @@ -121,16 +121,17 @@ static std::vector> vDynamic = { if (match.size() != 4) break; - int r = std::clamp(std::stoi(match[1]), 0, 255); - int g = std::clamp(std::stoi(match[2]), 0, 255); - int b = std::clamp(std::stoi(match[3]), 0, 255); + int r = !match[1].str().empty() ? std::stoi(match[1]) : 255; + int g = !match[2].str().empty() ? std::stoi(match[2]) : 255; + int b = !match[3].str().empty() ? std::stoi(match[3]) : 255; - sCmdString = sCmdString.replace(match.position(), match.length(), std::format(PRE_STR"\x7""{:02x}{:02x}{:02x}", r, g, b)); + Color_t tColor; tColor.SetRGB(r, g, b); + sCmdString = sCmdString.replace(match.position(), match.length(), std::format(PRE_STR"{}", tColor.ToHex())); } }, [&]() { - auto sRegex = R"(\\\{rgba:(\d+),(\d+),(\d+),(\d+)\})"; + auto sRegex = R"(\\\{rgba:(\d+)?(?:,(\d+))?(?:,(\d+))?(?:,(\d+))?\})"; while (true) { @@ -138,17 +139,36 @@ static std::vector> vDynamic = { if (match.size() != 5) break; - int r = std::clamp(std::stoi(match[1]), 0, 255); - int g = std::clamp(std::stoi(match[2]), 0, 255); - int b = std::clamp(std::stoi(match[3]), 0, 255); - int a = std::clamp(std::stoi(match[4]), 0, 255); + int r = !match[1].str().empty() ? std::stoi(match[1]) : 255; + int g = !match[2].str().empty() ? std::stoi(match[2]) : 255; + int b = !match[3].str().empty() ? std::stoi(match[3]) : 255; + int a = !match[4].str().empty() ? std::stoi(match[4]) : 255; - sCmdString = sCmdString.replace(match.position(), match.length(), std::format(PRE_STR"\x8""{:02x}{:02x}{:02x}{:02x}", r, g, b, a)); + Color_t tColor; tColor.SetRGB(r, g, b, a); + sCmdString = sCmdString.replace(match.position(), match.length(), std::format(PRE_STR"{}", tColor.ToHexA())); } }, [&]() { - auto sRegex = R"(\\\{hsv:(?:(\d+)|(\d+),(\d+),(\d+))\})"; + auto sRegex = R"(\\\{hsv:(\d+)?(?:,(\d+))?(?:,(\d+))?\})"; + + while (true) + { + std::smatch match; std::regex_search(sCmdString, match, std::regex(sRegex)); + if (match.size() != 4) + break; + + int h = !match[1].str().empty() ? std::stoi(match[1]) : 0; + int s = !match[2].str().empty() ? std::stoi(match[2]) : 100; + int v = !match[3].str().empty() ? std::stoi(match[3]) : 100; + + Color_t tColor; tColor.SetHSV(h, s, v); + sCmdString = sCmdString.replace(match.position(), match.length(), std::format(PRE_STR"{}", tColor.ToHex())); + } + }, + [&]() + { + auto sRegex = R"(\\\{hsva:(\d+)?(?:,(\d+))?(?:,(\d+))?(?:,(\d+))?\})"; while (true) { @@ -156,53 +176,13 @@ static std::vector> vDynamic = { if (match.size() != 5) break; - int h, s, v; - if (!match[1].str().empty()) - { - h = std::clamp(std::stoi(match[1]), 0, 360); - s = 100; - v = 100; - } - else - { - h = std::clamp(std::stoi(match[2]), 0, 360); - s = std::clamp(std::stoi(match[3]), 0, 100); - v = std::clamp(std::stoi(match[4]), 0, 100); - } + int h = !match[1].str().empty() ? std::stoi(match[1]) : 0; + int s = !match[2].str().empty() ? std::stoi(match[2]) : 100; + int v = !match[3].str().empty() ? std::stoi(match[3]) : 100; + int a = !match[4].str().empty() ? std::stoi(match[4]) : 255; - int r, g, b; - { - float s2 = s / 100.f; - float v2 = v / 100.f; - - float r2, g2, b2; - if (s2 == 0) - r2 = g2 = b2 = v2; - else - { - float h2 = h / 60.f; - int i = floor(h2); - float f = h2 - i; - float p = v2 * (1 - s2); - float q = v2 * (1 - f * s2); - float t = v2 * (1 - (1 - f) * s2); - - switch (i) - { - case 0: r2 = v2; g2 = t; b2 = p; break; - case 1: r2 = q; g2 = v2; b2 = p; break; - case 2: r2 = p; g2 = v2; b2 = t; break; - case 3: r2 = p; g2 = q; b2 = v2; break; - case 4: r2 = t; g2 = p; b2 = v2; break; - default: r2 = v2; g2 = p; b2 = q; break; - } - } - r = std::clamp(r2 * 255.f, 0.f, 255.f); - g = std::clamp(g2 * 255.f, 0.f, 255.f); - b = std::clamp(b2 * 255.f, 0.f, 255.f); - } - - sCmdString = sCmdString.replace(match.position(), match.length(), std::format(PRE_STR"\x7""{:02x}{:02x}{:02x}", r, g, b)); + Color_t tColor; tColor.SetHSV(h, s, v, a); + sCmdString = sCmdString.replace(match.position(), match.length(), std::format(PRE_STR"{}", tColor.ToHexA())); } }, [&]() @@ -230,6 +210,11 @@ static std::vector> vDynamic = { MAKE_HOOK(Cbuf_ExecuteCommand, S::Cbuf_ExecuteCommand(), void, CCommand& args, cmd_source_t source) { +#ifdef DEBUG_HOOKS + if (!Vars::Hooks::Cbuf_ExecuteCommand[DEFAULT_BIND]) + return CALL_ORIGINAL(rcx, ray, fMask, pTraceFilter, pTrace); +#endif + if (args.ArgC()) { std::string sCommand = args[0]; diff --git a/Amalgam/src/Hooks/ClientModeTFNormal_BIsFriendOrPartyMember.cpp b/Amalgam/src/Hooks/ClientModeTFNormal_BIsFriendOrPartyMember.cpp index 3e5067ee..5b541e8b 100644 --- a/Amalgam/src/Hooks/ClientModeTFNormal_BIsFriendOrPartyMember.cpp +++ b/Amalgam/src/Hooks/ClientModeTFNormal_BIsFriendOrPartyMember.cpp @@ -6,7 +6,7 @@ MAKE_HOOK(ClientModeTFNormal_BIsFriendOrPartyMember, S::ClientModeTFNormal_BIsFr void* rcx, CBaseEntity* pEntity) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::ClientModeTFNormal_BIsFriendOrPartyMember.Map[DEFAULT_BIND]) + if (!Vars::Hooks::ClientModeTFNormal_BIsFriendOrPartyMember[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, pEntity); #endif diff --git a/Amalgam/src/Hooks/ClientModeTFNormal_UpdateSteamRichPresence.cpp b/Amalgam/src/Hooks/ClientModeTFNormal_UpdateSteamRichPresence.cpp index 63f84c52..a200a29d 100644 --- a/Amalgam/src/Hooks/ClientModeTFNormal_UpdateSteamRichPresence.cpp +++ b/Amalgam/src/Hooks/ClientModeTFNormal_UpdateSteamRichPresence.cpp @@ -8,7 +8,7 @@ MAKE_HOOK(ClientModeTFNormal_UpdateSteamRichPresence, S::ClientModeTFNormal_Upda void* rcx) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::ClientModeTFNormal_UpdateSteamRichPresence.Map[DEFAULT_BIND]) + if (!Vars::Hooks::ClientModeTFNormal_UpdateSteamRichPresence[DEFAULT_BIND]) return CALL_ORIGINAL(rcx); #endif diff --git a/Amalgam/src/Hooks/DSP_Process.cpp b/Amalgam/src/Hooks/DSP_Process.cpp index b84dddb3..11062ac2 100644 --- a/Amalgam/src/Hooks/DSP_Process.cpp +++ b/Amalgam/src/Hooks/DSP_Process.cpp @@ -6,7 +6,7 @@ MAKE_HOOK(DSP_Process, S::DSP_Process(), void, unsigned int idsp, int* pbfront, int* pbrear, int* pbcenter, int sampleCount) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::DSP_Process.Map[DEFAULT_BIND]) + if (!Vars::Hooks::DSP_Process[DEFAULT_BIND]) return CALL_ORIGINAL(idsp, pbfront, pbrear, pbcenter, sampleCount); #endif diff --git a/Amalgam/src/Hooks/DoEnginePostProcessing.cpp b/Amalgam/src/Hooks/DoEnginePostProcessing.cpp index c5a227b9..f536eefc 100644 --- a/Amalgam/src/Hooks/DoEnginePostProcessing.cpp +++ b/Amalgam/src/Hooks/DoEnginePostProcessing.cpp @@ -6,7 +6,7 @@ MAKE_HOOK(DoEnginePostProcessing, S::DoEnginePostProcessing(), void, int x, int y, int w, int h, bool bFlashlightIsOn, bool bPostVGui) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::DoEnginePostProcessing.Map[DEFAULT_BIND]) + if (!Vars::Hooks::DoEnginePostProcessing[DEFAULT_BIND]) return CALL_ORIGINAL(x, y, w, h, bFlashlightIsOn, bPostVGui); #endif diff --git a/Amalgam/src/Hooks/FX_FireBullets.cpp b/Amalgam/src/Hooks/FX_FireBullets.cpp index 9543c3f2..b1d4b3a0 100644 --- a/Amalgam/src/Hooks/FX_FireBullets.cpp +++ b/Amalgam/src/Hooks/FX_FireBullets.cpp @@ -11,7 +11,7 @@ MAKE_HOOK(FX_FireBullets, S::FX_FireBullets(), void, void* pWpn, int iPlayer, const Vec3& vecOrigin, const Vec3& vecAngles, int iWeapon, int iMode, int iSeed, float flSpread, float flDamage, bool bCritical) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::FX_FireBullets.Map[DEFAULT_BIND]) + if (!Vars::Hooks::FX_FireBullets[DEFAULT_BIND]) return CALL_ORIGINAL(pWpn, iPlayer, vecOrigin, vecAngles, iWeapon, iMode, iSeed, flSpread, flDamage, bCritical); #endif @@ -33,7 +33,7 @@ MAKE_HOOK(FX_FireBullets_Server, S::FX_FireBullets_Server(), void, void* pWpn, int iPlayer, const Vec3& vecOrigin, const Vec3& vecAngles, int iWeapon, int iMode, int iSeed, float flSpread, float flDamage, bool bCritical) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::FX_FireBullets.Map[DEFAULT_BIND]) + if (!Vars::Hooks::FX_FireBullets[DEFAULT_BIND]) return CALL_ORIGINAL(pWpn, iPlayer, vecOrigin, vecAngles, iWeapon, iMode, iSeed, flSpread, flDamage, bCritical); #endif diff --git a/Amalgam/src/Hooks/GenerateEquipRegionConflictMask.cpp b/Amalgam/src/Hooks/GenerateEquipRegionConflictMask.cpp index 73be6624..aeda69b1 100644 --- a/Amalgam/src/Hooks/GenerateEquipRegionConflictMask.cpp +++ b/Amalgam/src/Hooks/GenerateEquipRegionConflictMask.cpp @@ -9,7 +9,7 @@ MAKE_HOOK(GenerateEquipRegionConflictMask, S::GenerateEquipRegionConflictMask(), int iClass, int iUpToSlot, int iIgnoreSlot) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::GenerateEquipRegionConflictMask.Map[DEFAULT_BIND]) + if (!Vars::Hooks::GenerateEquipRegionConflictMask[DEFAULT_BIND]) return CALL_ORIGINAL(iClass, iUpToSlot, iIgnoreSlot); #endif @@ -20,7 +20,7 @@ MAKE_HOOK(CTFInventoryManager_GetItemInLoadoutForClass, S::CTFInventoryManager_G void* rcx, int iClass, int iSlot, CSteamID* pID) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::GenerateEquipRegionConflictMask.Map[DEFAULT_BIND]) + if (!Vars::Hooks::GenerateEquipRegionConflictMask[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, iClass, iSlot, pID); #endif @@ -34,7 +34,7 @@ MAKE_HOOK(CTFPlayerInventory_VerifyChangedLoadoutsAreValid, S::CTFPlayerInventor void* rcx) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::GenerateEquipRegionConflictMask.Map[DEFAULT_BIND]) + if (!Vars::Hooks::GenerateEquipRegionConflictMask[DEFAULT_BIND]) return CALL_ORIGINAL(rcx); #endif diff --git a/Amalgam/src/Hooks/GetClientInterpAmount.cpp b/Amalgam/src/Hooks/GetClientInterpAmount.cpp index 9e1acb2c..04421893 100644 --- a/Amalgam/src/Hooks/GetClientInterpAmount.cpp +++ b/Amalgam/src/Hooks/GetClientInterpAmount.cpp @@ -8,7 +8,7 @@ MAKE_HOOK(GetClientInterpAmount, S::GetClientInterpAmount(), float, ) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::GetClientInterpAmount.Map[DEFAULT_BIND]) + if (!Vars::Hooks::GetClientInterpAmount[DEFAULT_BIND]) return CALL_ORIGINAL(); #endif diff --git a/Amalgam/src/Hooks/HostState_Shutdown.cpp b/Amalgam/src/Hooks/HostState_Shutdown.cpp index c9417d34..f0ebff8a 100644 --- a/Amalgam/src/Hooks/HostState_Shutdown.cpp +++ b/Amalgam/src/Hooks/HostState_Shutdown.cpp @@ -9,7 +9,7 @@ MAKE_HOOK(HostState_Shutdown, S::HostState_Shutdown(), void, ) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::HostState_Shutdown.Map[DEFAULT_BIND]) + if (!Vars::Hooks::HostState_Shutdown[DEFAULT_BIND]) return CALL_ORIGINAL(); #endif @@ -21,7 +21,7 @@ MAKE_HOOK(HostState_Restart, S::HostState_Restart(), void, ) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::HostState_Shutdown.Map[DEFAULT_BIND]) + if (!Vars::Hooks::HostState_Shutdown[DEFAULT_BIND]) return CALL_ORIGINAL(); #endif diff --git a/Amalgam/src/Hooks/IBaseClientDLL_DispatchUserMessage.cpp b/Amalgam/src/Hooks/IBaseClientDLL_DispatchUserMessage.cpp index 6ec68436..669f33fb 100644 --- a/Amalgam/src/Hooks/IBaseClientDLL_DispatchUserMessage.cpp +++ b/Amalgam/src/Hooks/IBaseClientDLL_DispatchUserMessage.cpp @@ -18,7 +18,7 @@ MAKE_HOOK(IBaseClientDLL_DispatchUserMessage, U::Memory.GetVFunc(I::BaseClientDL void* rcx, UserMessageType type, bf_read& msgData) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::IBaseClientDLL_DispatchUserMessage.Map[DEFAULT_BIND]) + if (!Vars::Hooks::IBaseClientDLL_DispatchUserMessage[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, type, msgData); #endif diff --git a/Amalgam/src/Hooks/IBaseClientDLL_FrameStageNotify.cpp b/Amalgam/src/Hooks/IBaseClientDLL_FrameStageNotify.cpp index 896f079e..b5b4c31b 100644 --- a/Amalgam/src/Hooks/IBaseClientDLL_FrameStageNotify.cpp +++ b/Amalgam/src/Hooks/IBaseClientDLL_FrameStageNotify.cpp @@ -17,7 +17,7 @@ MAKE_HOOK(IBaseClientDLL_FrameStageNotify, U::Memory.GetVFunc(I::BaseClientDLL, void* rcx, ClientFrameStage_t curStage) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::IBaseClientDLL_FrameStageNotify.Map[DEFAULT_BIND]) + if (!Vars::Hooks::IBaseClientDLL_FrameStageNotify[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, curStage); #endif diff --git a/Amalgam/src/Hooks/IBaseClientDLL_LevelShutdown.cpp b/Amalgam/src/Hooks/IBaseClientDLL_LevelShutdown.cpp index 1fc7159d..f39bb01b 100644 --- a/Amalgam/src/Hooks/IBaseClientDLL_LevelShutdown.cpp +++ b/Amalgam/src/Hooks/IBaseClientDLL_LevelShutdown.cpp @@ -6,7 +6,7 @@ MAKE_HOOK(IBaseClientDLL_LevelShutdown, U::Memory.GetVFunc(I::BaseClientDLL, 7), void* rcx) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::IBaseClientDLL_LevelShutdown.Map[DEFAULT_BIND]) + if (!Vars::Hooks::IBaseClientDLL_LevelShutdown[DEFAULT_BIND]) return CALL_ORIGINAL(rcx); #endif diff --git a/Amalgam/src/Hooks/IEngineTrace_SetTraceEntity.cpp b/Amalgam/src/Hooks/IEngineTrace_SetTraceEntity.cpp new file mode 100644 index 00000000..5e1f06f4 --- /dev/null +++ b/Amalgam/src/Hooks/IEngineTrace_SetTraceEntity.cpp @@ -0,0 +1,143 @@ +#include "../SDK/SDK.h" + +MAKE_SIGNATURE(CM_BoxTrace, "engine.dll", "48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 48 89 7C 24 ? 41 56 48 83 EC ? 45 0F B6 F1", 0x0); +MAKE_SIGNATURE(CM_TraceToLeaf_True, "engine.dll", "48 8B C4 55 57 48 81 EC ? ? ? ? 48 8B B9 ? ? ? ? 48 8B E9 44 0F 29 40 ? 44 0F 28 C3 44 0F 29 48 ? 44 0F 28 CA 85 D2 0F 88 ? ? ? ? 3B 97 ? ? ? ? 0F 8D ? ? ? ? 48 63 89 ? ? ? ? 48 89 70 ? 4C 89 60 ? 4C 89 68 ? 44 8B AC 8D ? ? ? ? 4C 89 70 ? 45 33 F6 4C 89 78 ? 0F 29 78 ? 0F 57 FF 4C 63 FA 49 C1 E7 ? 4C 03 BF ? ? ? ? 48 89 58 ? 48 8B C1 48 C1 E0 ? 41 0F B7 77 ? 41 0F B7 57 ? 4C 8B A4 28 ? ? ? ? 03 D6 3B F2 0F 83 ? ? ? ? 8B C2 8B DE 48 89 84 24 ? ? ? ? 41 BA ? ? ? ? 48 85 DB 0F 88 ? ? ? ? 3B B7 ? ? ? ? 0F 8D ? ? ? ? 48 8B 87 ? ? ? ? 0F B7 0C 58 3B 8F ? ? ? ? 0F 8D ? ? ? ? 48 8B 87 ? ? ? ? 4C 8D 1C C8 45 39 2C 8C 0F 84 ? ? ? ? 45 89 2C 8C 41 8B 03 8B 8D ? ? ? ? 23 C1 0F 84 ? ? ? ? 3D ? ? ? ? 0F 85 ? ? ? ? 0F BA E1 ? 0F 83 ? ? ? ? 41 0F B7 4B ? 41 0F B7 43 ? 4C 8B 8D ? ? ? ? 66 41 3B CA 75 ? 41 3B 81 ? ? ? ? 0F 8D ? ? ? ? 48 8D 14 40 4D 8B C6 48 C1 E2 ? 48 83 C2 ? 49 03 91 ? ? ? ? 0F B7 0A 66 41 3B CA 75 ? 48 8D 05 ? ? ? ? EB ? 41 3B 89 ? ? ? ? 0F 8D ? ? ? ? 48 8B C1 48 C1 E0 ? 49 03 81 ? ? ? ? F6 40 ? ? 0F 85 ? ? ? ? 49 FF C0 48 83 C2 ? 49 83 F8 ? 7C ? EB ? 41 3B 41 ? 0F 8D ? ? ? ? 48 8B D0 45 8B C6 48 C1 E2 ? 44 8B D1 48 83 C2 ? 85 C9 74 ? 49 03 51 ? 66 90 0F B7 0A B8 ? ? ? ? 66 3B C8 75 ? 48 8D 05 ? ? ? ? EB ? 41 3B 89 ? ? ? ? 0F 8D ? ? ? ? 48 8B C1 48 C1 E0 ? 49 03 81 ? ? ? ? F6 40 ? ? 75 ? 41 FF C0 48 83 C2 ? 45 3B C2 7C ? 49 8B D3 48 8B CD E8 ? ? ? ? 0F 2E BD ? ? ? ? 0F 84 ? ? ? ? 41 BA ? ? ? ? FF C6 48 FF C3 48 3B 9C 24 ? ? ? ? 0F 8C ? ? ? ? 44 38 B5 ? ? ? ? 0F 85 ? ? ? ? 41 0F B7 57 ? 66 85 D2 0F 84 ? ? ? ? 48 63 8D ? ? ? ? 48 8B C1 0F 29 74 24", 0x0); +MAKE_SIGNATURE(CM_TraceToLeaf_False, "engine.dll", "48 8B C4 55 57 48 81 EC ? ? ? ? 48 8B B9 ? ? ? ? 48 8B E9 44 0F 29 40 ? 44 0F 28 C3 44 0F 29 48 ? 44 0F 28 CA 85 D2 0F 88 ? ? ? ? 3B 97 ? ? ? ? 0F 8D ? ? ? ? 48 63 89 ? ? ? ? 48 89 70 ? 4C 89 60 ? 4C 89 68 ? 44 8B AC 8D ? ? ? ? 4C 89 70 ? 45 33 F6 4C 89 78 ? 0F 29 78 ? 0F 57 FF 4C 63 FA 49 C1 E7 ? 4C 03 BF ? ? ? ? 48 89 58 ? 48 8B C1 48 C1 E0 ? 41 0F B7 77 ? 41 0F B7 57 ? 4C 8B A4 28 ? ? ? ? 03 D6 3B F2 0F 83 ? ? ? ? 8B C2 8B DE 48 89 84 24 ? ? ? ? 41 BA ? ? ? ? 48 85 DB 0F 88 ? ? ? ? 3B B7 ? ? ? ? 0F 8D ? ? ? ? 48 8B 87 ? ? ? ? 0F B7 0C 58 3B 8F ? ? ? ? 0F 8D ? ? ? ? 48 8B 87 ? ? ? ? 4C 8D 1C C8 45 39 2C 8C 0F 84 ? ? ? ? 45 89 2C 8C 41 8B 03 8B 8D ? ? ? ? 23 C1 0F 84 ? ? ? ? 3D ? ? ? ? 0F 85 ? ? ? ? 0F BA E1 ? 0F 83 ? ? ? ? 41 0F B7 4B ? 41 0F B7 43 ? 4C 8B 8D ? ? ? ? 66 41 3B CA 75 ? 41 3B 81 ? ? ? ? 0F 8D ? ? ? ? 48 8D 14 40 4D 8B C6 48 C1 E2 ? 48 83 C2 ? 49 03 91 ? ? ? ? 0F B7 0A 66 41 3B CA 75 ? 48 8D 05 ? ? ? ? EB ? 41 3B 89 ? ? ? ? 0F 8D ? ? ? ? 48 8B C1 48 C1 E0 ? 49 03 81 ? ? ? ? F6 40 ? ? 0F 85 ? ? ? ? 49 FF C0 48 83 C2 ? 49 83 F8 ? 7C ? EB ? 41 3B 41 ? 0F 8D ? ? ? ? 48 8B D0 45 8B C6 48 C1 E2 ? 44 8B D1 48 83 C2 ? 85 C9 74 ? 49 03 51 ? 66 90 0F B7 0A B8 ? ? ? ? 66 3B C8 75 ? 48 8D 05 ? ? ? ? EB ? 41 3B 89 ? ? ? ? 0F 8D ? ? ? ? 48 8B C1 48 C1 E0 ? 49 03 81 ? ? ? ? F6 40 ? ? 75 ? 41 FF C0 48 83 C2 ? 45 3B C2 7C ? 49 8B D3 48 8B CD E8 ? ? ? ? 0F 2E BD ? ? ? ? 0F 84 ? ? ? ? 41 BA ? ? ? ? FF C6 48 FF C3 48 3B 9C 24 ? ? ? ? 0F 8C ? ? ? ? 44 38 B5 ? ? ? ? 0F 85 ? ? ? ? 41 0F B7 57 ? 66 85 D2 0F 84 ? ? ? ? 48 63 8D ? ? ? ? 48 8B C1 0F 29 B4 24", 0x0); +MAKE_SIGNATURE(CM_ClipBoxToBrush_True, "engine.dll", "48 89 5C 24 ? 57 48 81 EC ? ? ? ? 44 0F B7 42", 0x0); +MAKE_SIGNATURE(CM_ClipBoxToBrush_False, "engine.dll", "48 8B C4 48 89 58 ? 57 48 81 EC ? ? ? ? 44 0F B7 42", 0x0); +MAKE_SIGNATURE(IEngineTrace_TraceRay_SetTraceEntity_Call, "engine.dll", "40 38 7E ? 0F 85", 0x0); + +#define MAX_CHECK_COUNT_DEPTH 2 +typedef uint32 TraceCounter_t; +typedef CUtlVector CTraceCounterVec; + +struct TraceInfo_t +{ + Vector m_start; + Vector m_end; + Vector m_mins; + Vector m_maxs; + Vector m_extents; + Vector m_delta; + Vector m_invDelta; + trace_t m_trace; + trace_t m_stabTrace; + int m_contents; + bool m_ispoint; + bool m_isswept; + void* m_pBSPData; + Vector m_DispStabDir; + int m_bDispHit; + bool m_bCheckPrimary; + int m_nCheckDepth; + TraceCounter_t m_Count[MAX_CHECK_COUNT_DEPTH]; + CTraceCounterVec m_BrushCounters[MAX_CHECK_COUNT_DEPTH]; + CTraceCounterVec m_DispCounters[MAX_CHECK_COUNT_DEPTH]; +}; + +static int iOriginalMask = false; +static bool bOriginalStartSolid = false; + +MAKE_HOOK(IEngineTrace_SetTraceEntity, U::Memory.GetVFunc(I::EngineTrace, 20), void, + void* rcx, ICollideable* pCollideable, trace_t* pTrace) +{ +#ifdef DEBUG_HOOKS + if (!Vars::Hooks::IEngineTrace_SetTraceEntity[DEFAULT_BIND]) + return CALL_ORIGINAL(rcx, ray, fMask, pTraceFilter, pTrace); +#endif + + static const auto dwDesired = S::IEngineTrace_TraceRay_SetTraceEntity_Call(); + const auto dwRetAddr = uintptr_t(_ReturnAddress()); + + CALL_ORIGINAL(rcx, pCollideable, pTrace); + + if (dwRetAddr && dwDesired && iOriginalMask & CONTENTS_NOSTARTSOLID) + pTrace->startsolid = false; +} + +MAKE_HOOK(CM_BoxTrace, S::CM_BoxTrace(), void, + const Ray_t& ray, int headnode, int brushmask, bool computeEndpt, trace_t& tr) +{ +#ifdef DEBUG_HOOKS + if (!Vars::Hooks::IEngineTrace_SetTraceEntity[DEFAULT_BIND]) + return CALL_ORIGINAL(rcx, ray, fMask, pTraceFilter, pTrace); +#endif + + CALL_ORIGINAL(ray, headnode, brushmask, computeEndpt, tr); + + iOriginalMask = brushmask; +} + +MAKE_HOOK(CM_TraceToLeaf_True, S::CM_TraceToLeaf_True(), void, + TraceInfo_t* pTraceInfo, int ndxLeaf, float startFrac, float endFrac) +{ +#ifdef DEBUG_HOOKS + if (!Vars::Hooks::IEngineTrace_SetTraceEntity[DEFAULT_BIND]) + return CALL_ORIGINAL(rcx, ray, fMask, pTraceFilter, pTrace); +#endif + + if (pTraceInfo->m_contents & CONTENTS_NOSTARTSOLID) + { + bOriginalStartSolid = pTraceInfo->m_trace.startsolid; + pTraceInfo->m_trace.startsolid = false; + CALL_ORIGINAL(pTraceInfo, ndxLeaf, startFrac, endFrac); + pTraceInfo->m_trace.startsolid = bOriginalStartSolid; + return; + } + + CALL_ORIGINAL(pTraceInfo, ndxLeaf, startFrac, endFrac); +} + +MAKE_HOOK(CM_TraceToLeaf_False, S::CM_TraceToLeaf_False(), void, + TraceInfo_t* pTraceInfo, int ndxLeaf, float startFrac, float endFrac) +{ +#ifdef DEBUG_HOOKS + if (!Vars::Hooks::IEngineTrace_SetTraceEntity[DEFAULT_BIND]) + return CALL_ORIGINAL(rcx, ray, fMask, pTraceFilter, pTrace); +#endif + + if (pTraceInfo->m_contents & CONTENTS_NOSTARTSOLID) + { + bOriginalStartSolid = pTraceInfo->m_trace.startsolid; + pTraceInfo->m_trace.startsolid = false; + CALL_ORIGINAL(pTraceInfo, ndxLeaf, startFrac, endFrac); + pTraceInfo->m_trace.startsolid = bOriginalStartSolid; + return; + } + + CALL_ORIGINAL(pTraceInfo, ndxLeaf, startFrac, endFrac); +} + +MAKE_HOOK(CM_ClipBoxToBrush_True, S::CM_ClipBoxToBrush_True(), void, + TraceInfo_t* pTraceInfo, void* brush) +{ +#ifdef DEBUG_HOOKS + if (!Vars::Hooks::IEngineTrace_SetTraceEntity[DEFAULT_BIND]) + return CALL_ORIGINAL(rcx, ray, fMask, pTraceFilter, pTrace); +#endif + + CALL_ORIGINAL(pTraceInfo, brush); + + if (pTraceInfo->m_contents & CONTENTS_NOSTARTSOLID && pTraceInfo->m_trace.startsolid) + { + bOriginalStartSolid = true; + pTraceInfo->m_trace.startsolid = false; + } +} + +MAKE_HOOK(CM_ClipBoxToBrush_False, S::CM_ClipBoxToBrush_False(), void, + TraceInfo_t* pTraceInfo, void* brush) +{ +#ifdef DEBUG_HOOKS + if (!Vars::Hooks::IEngineTrace_SetTraceEntity[DEFAULT_BIND]) + return CALL_ORIGINAL(rcx, ray, fMask, pTraceFilter, pTrace); +#endif + + CALL_ORIGINAL(pTraceInfo, brush); + + if (pTraceInfo->m_contents & CONTENTS_NOSTARTSOLID && pTraceInfo->m_trace.startsolid) + { + bOriginalStartSolid = true; + pTraceInfo->m_trace.startsolid = false; + } +} \ No newline at end of file diff --git a/Amalgam/src/Hooks/IEngineTrace_TraceRay.cpp b/Amalgam/src/Hooks/IEngineTrace_TraceRay.cpp index cc80639b..9a8776b2 100644 --- a/Amalgam/src/Hooks/IEngineTrace_TraceRay.cpp +++ b/Amalgam/src/Hooks/IEngineTrace_TraceRay.cpp @@ -5,7 +5,7 @@ MAKE_HOOK(IEngineTrace_TraceRay, U::Memory.GetVFunc(I::EngineTrace, 4), void, void* rcx, const Ray_t& ray, unsigned int fMask, ITraceFilter* pTraceFilter, trace_t* pTrace) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::IEngineTrace_TraceRay.Map[DEFAULT_BIND]) + if (!Vars::Hooks::IEngineTrace_TraceRay[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, ray, fMask, pTraceFilter, pTrace); #endif diff --git a/Amalgam/src/Hooks/IEngineVGui_Paint.cpp b/Amalgam/src/Hooks/IEngineVGui_Paint.cpp index 6ff9df2f..a527c778 100644 --- a/Amalgam/src/Hooks/IEngineVGui_Paint.cpp +++ b/Amalgam/src/Hooks/IEngineVGui_Paint.cpp @@ -21,9 +21,13 @@ static inline void Paint() return I::MatSystemSurface->FinishDrawing(); // dumb FUCKN+IG CHeck for fonts - int w = 0, h = 0; I::MatSystemSurface->GetTextSize(H::Fonts.GetFont(FONT_ESP).m_dwFont, L"", w, h); - if (!h) - H::Fonts.Reload(Vars::Menu::Scale.Map[DEFAULT_BIND]); + static Timer tTimer = {}; + if (tTimer.Run(1.f)) + { + int w = 0, h = 0; I::MatSystemSurface->GetTextSize(H::Fonts.GetFont(FONT_ESP).m_dwFont, L"", w, h); + if (!h) + H::Fonts.Reload(Vars::Menu::Scale[DEFAULT_BIND]); + } auto pLocal = H::Entities.GetLocal(); if (pLocal && !I::EngineVGui->IsGameUIVisible()) @@ -56,7 +60,7 @@ MAKE_HOOK(IEngineVGui_Paint, U::Memory.GetVFunc(I::EngineVGui, 14), void, void* rcx, int iMode) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::IEngineVGui_Paint.Map[DEFAULT_BIND]) + if (!Vars::Hooks::IEngineVGui_Paint[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, iMode); #endif diff --git a/Amalgam/src/Hooks/IInput_GetUserCmd.cpp b/Amalgam/src/Hooks/IInput_GetUserCmd.cpp index 700ec3e0..6a0b9955 100644 --- a/Amalgam/src/Hooks/IInput_GetUserCmd.cpp +++ b/Amalgam/src/Hooks/IInput_GetUserCmd.cpp @@ -4,7 +4,7 @@ MAKE_HOOK(IInput_GetUserCmd, U::Memory.GetVFunc(I::Input, 8), CUserCmd*, void* rcx, int sequence_number) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::IInput_GetUserCmd.Map[DEFAULT_BIND]) + if (!Vars::Hooks::IInput_GetUserCmd[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, sequence_number); #endif diff --git a/Amalgam/src/Hooks/IPanel_PaintTraverse.cpp b/Amalgam/src/Hooks/IPanel_PaintTraverse.cpp index 224a62b0..61fed7fa 100644 --- a/Amalgam/src/Hooks/IPanel_PaintTraverse.cpp +++ b/Amalgam/src/Hooks/IPanel_PaintTraverse.cpp @@ -4,7 +4,7 @@ MAKE_HOOK(IPanel_PaintTraverse, U::Memory.GetVFunc(I::Panel, 41), void, void* rcx, VPANEL vguiPanel, bool forceRepaint, bool allowForce) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::IPanel_PaintTraverse.Map[DEFAULT_BIND]) + if (!Vars::Hooks::IPanel_PaintTraverse[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, vguiPanel, forceRepaint, allowForce); #endif diff --git a/Amalgam/src/Hooks/ISteamFriends_GetFriendPersonaName.cpp b/Amalgam/src/Hooks/ISteamFriends_GetFriendPersonaName.cpp index 2378948e..4fb676c2 100644 --- a/Amalgam/src/Hooks/ISteamFriends_GetFriendPersonaName.cpp +++ b/Amalgam/src/Hooks/ISteamFriends_GetFriendPersonaName.cpp @@ -8,7 +8,7 @@ MAKE_HOOK(ISteamFriends_GetFriendPersonaName, U::Memory.GetVFunc(I::SteamFriends void* rcx, CSteamID steamIDFriend) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::ISteamFriends_GetFriendPersonaName.Map[DEFAULT_BIND]) + if (!Vars::Hooks::ISteamFriends_GetFriendPersonaName[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, steamIDFriend); #endif diff --git a/Amalgam/src/Hooks/ISteamNetworkingUtils_GetPingToDataCenter.cpp b/Amalgam/src/Hooks/ISteamNetworkingUtils_GetPingToDataCenter.cpp index ebb92616..b554d15c 100644 --- a/Amalgam/src/Hooks/ISteamNetworkingUtils_GetPingToDataCenter.cpp +++ b/Amalgam/src/Hooks/ISteamNetworkingUtils_GetPingToDataCenter.cpp @@ -54,7 +54,7 @@ MAKE_HOOK(ISteamNetworkingUtils_GetPingToDataCenter, U::Memory.GetVFunc(I::Steam void* rcx, SteamNetworkingPOPID popID, SteamNetworkingPOPID* pViaRelayPoP) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::ISteamNetworkingUtils_GetPingToDataCenter.Map[DEFAULT_BIND]) + if (!Vars::Hooks::ISteamNetworkingUtils_GetPingToDataCenter[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, popID, pViaRelayPoP); #endif @@ -74,7 +74,7 @@ MAKE_HOOK(CTFPartyClient_RequestQueueForMatch, S::CTFPartyClient_RequestQueueFor void* rcx, int eMatchGroup) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::ISteamNetworkingUtils_GetPingToDataCenter.Map[DEFAULT_BIND]) + if (!Vars::Hooks::ISteamNetworkingUtils_GetPingToDataCenter[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, eMatchGroup); #endif diff --git a/Amalgam/src/Hooks/IVEngineClient_ClientCmd_Unrestricted.cpp b/Amalgam/src/Hooks/IVEngineClient_ClientCmd_Unrestricted.cpp index af9d5a73..c4d36663 100644 --- a/Amalgam/src/Hooks/IVEngineClient_ClientCmd_Unrestricted.cpp +++ b/Amalgam/src/Hooks/IVEngineClient_ClientCmd_Unrestricted.cpp @@ -25,7 +25,7 @@ MAKE_HOOK(IVEngineClient_ClientCmd_Unrestricted, U::Memory.GetVFunc(I::EngineCli void* rcx, const char* szCmdString) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::IVEngineClient_ClientCmd_Unrestricted.Map[DEFAULT_BIND]) + if (!Vars::Hooks::IVEngineClient_ClientCmd_Unrestricted[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, szCmdString); #endif diff --git a/Amalgam/src/Hooks/IVModelRender_DrawModelExecute.cpp b/Amalgam/src/Hooks/IVModelRender_DrawModelExecute.cpp index dd2051c6..653ec0e7 100644 --- a/Amalgam/src/Hooks/IVModelRender_DrawModelExecute.cpp +++ b/Amalgam/src/Hooks/IVModelRender_DrawModelExecute.cpp @@ -13,7 +13,7 @@ MAKE_HOOK(IVModelRender_DrawModelExecute, U::Memory.GetVFunc(I::ModelRender, 19) void* rcx, const DrawModelState_t& pState, const ModelRenderInfo_t& pInfo, matrix3x4* pBoneToWorld) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::IVModelRender_DrawModelExecute.Map[DEFAULT_BIND]) + if (!Vars::Hooks::IVModelRender_DrawModelExecute[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, pState, pInfo, pBoneToWorld); #endif @@ -57,7 +57,7 @@ MAKE_HOOK(CBaseAnimating_DrawModel, S::CBaseAnimating_DrawModel(), int, void* rcx, int flags) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::IVModelRender_DrawModelExecute.Map[DEFAULT_BIND]) + if (!Vars::Hooks::IVModelRender_DrawModelExecute[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, flags); #endif @@ -78,7 +78,7 @@ MAKE_HOOK(CBaseAnimating_InternalDrawModel, S::CBaseAnimating_InternalDrawModel( void* rcx, int flags) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::IVModelRender_DrawModelExecute.Map[DEFAULT_BIND]) + if (!Vars::Hooks::IVModelRender_DrawModelExecute[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, flags); #endif diff --git a/Amalgam/src/Hooks/IVModelRender_ForcedMaterialOverride.cpp b/Amalgam/src/Hooks/IVModelRender_ForcedMaterialOverride.cpp index b0c65e38..30f1d7a1 100644 --- a/Amalgam/src/Hooks/IVModelRender_ForcedMaterialOverride.cpp +++ b/Amalgam/src/Hooks/IVModelRender_ForcedMaterialOverride.cpp @@ -8,7 +8,7 @@ MAKE_HOOK(IVModelRender_ForcedMaterialOverride, U::Memory.GetVFunc(I::ModelRende IVModelRender* rcx, IMaterial* mat, OverrideType_t type) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::IVModelRender_ForcedMaterialOverride.Map[DEFAULT_BIND]) + if (!Vars::Hooks::IVModelRender_ForcedMaterialOverride[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, mat, type); #endif diff --git a/Amalgam/src/Hooks/KeyValues_SetInt.cpp b/Amalgam/src/Hooks/KeyValues_SetInt.cpp index f5b00d14..b0bdf845 100644 --- a/Amalgam/src/Hooks/KeyValues_SetInt.cpp +++ b/Amalgam/src/Hooks/KeyValues_SetInt.cpp @@ -8,7 +8,7 @@ MAKE_HOOK(KeyValues_SetInt, S::KeyValues_SetInt(), void, void* rcx, const char* keyName, int value) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::KeyValues_SetInt.Map[DEFAULT_BIND]) + if (!Vars::Hooks::KeyValues_SetInt[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, keyName, value); #endif diff --git a/Amalgam/src/Hooks/NotificationQueue_Add.cpp b/Amalgam/src/Hooks/NotificationQueue_Add.cpp index 51115dd1..ba05fa85 100644 --- a/Amalgam/src/Hooks/NotificationQueue_Add.cpp +++ b/Amalgam/src/Hooks/NotificationQueue_Add.cpp @@ -6,7 +6,7 @@ MAKE_HOOK(NotificationQueue_Add, S::NotificationQueue_Add(), int, CEconNotification* pNotification) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::NotificationQueue_Add.Map[DEFAULT_BIND]) + if (!Vars::Hooks::NotificationQueue_Add[DEFAULT_BIND]) return CALL_ORIGINAL(pNotification); #endif diff --git a/Amalgam/src/Hooks/R_DrawSkyBox.cpp b/Amalgam/src/Hooks/R_DrawSkyBox.cpp index 57e7ac51..95e813fd 100644 --- a/Amalgam/src/Hooks/R_DrawSkyBox.cpp +++ b/Amalgam/src/Hooks/R_DrawSkyBox.cpp @@ -6,7 +6,7 @@ MAKE_HOOK(R_DrawSkyBox, S::R_DrawSkyBox(), void, float zFar, int nDrawFlags) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::R_DrawSkyBox.Map[DEFAULT_BIND]) + if (!Vars::Hooks::R_DrawSkyBox[DEFAULT_BIND]) return CALL_ORIGINAL(zFar, nDrawFlags); #endif diff --git a/Amalgam/src/Hooks/RecvProxy_SimulationTime.cpp b/Amalgam/src/Hooks/RecvProxy_SimulationTime.cpp index 4ce0c27f..24d65101 100644 --- a/Amalgam/src/Hooks/RecvProxy_SimulationTime.cpp +++ b/Amalgam/src/Hooks/RecvProxy_SimulationTime.cpp @@ -13,7 +13,7 @@ MAKE_HOOK(RecvProxy_SimulationTime, S::RecvProxy_SimulationTime(), void, const CRecvProxyData* pData, void* pStruct, void* pOut) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::RecvProxy_SimulationTime.Map[DEFAULT_BIND]) + if (!Vars::Hooks::RecvProxy_SimulationTime[DEFAULT_BIND]) return CALL_ORIGINAL(pData, pStruct, pOut); #endif diff --git a/Amalgam/src/Hooks/TF_IsHolidayActive.cpp b/Amalgam/src/Hooks/TF_IsHolidayActive.cpp index 0e57aa02..4440d8ba 100644 --- a/Amalgam/src/Hooks/TF_IsHolidayActive.cpp +++ b/Amalgam/src/Hooks/TF_IsHolidayActive.cpp @@ -24,7 +24,7 @@ MAKE_HOOK(TF_IsHolidayActive, S::TF_IsHolidayActive(), bool, int eHoliday) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::TF_IsHolidayActive.Map[DEFAULT_BIND]) + if (!Vars::Hooks::TF_IsHolidayActive[DEFAULT_BIND]) return CALL_ORIGINAL(eHoliday); #endif diff --git a/Amalgam/src/Hooks/VGuiMenuBuilder_AddMenuItem.cpp b/Amalgam/src/Hooks/VGuiMenuBuilder_AddMenuItem.cpp index 1dbb640f..78595933 100644 --- a/Amalgam/src/Hooks/VGuiMenuBuilder_AddMenuItem.cpp +++ b/Amalgam/src/Hooks/VGuiMenuBuilder_AddMenuItem.cpp @@ -18,7 +18,7 @@ MAKE_HOOK(CVoiceStatus_IsPlayerBlocked, S::CVoiceStatus_IsPlayerBlocked(), bool, void* rcx, int playerIndex) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::VGuiMenuBuilder_AddMenuItem.Map[DEFAULT_BIND]) + if (!Vars::Hooks::VGuiMenuBuilder_AddMenuItem[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, playerIndex); #endif @@ -35,7 +35,7 @@ MAKE_HOOK(VGuiMenuBuilder_AddMenuItem, S::VGuiMenuBuilder_AddMenuItem(), void*, void* rcx, const char* pszButtonText, const char* pszCommand, const char* pszCategoryName) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::VGuiMenuBuilder_AddMenuItem.Map[DEFAULT_BIND]) + if (!Vars::Hooks::VGuiMenuBuilder_AddMenuItem[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, pszButtonText, pszCommand, pszCategoryName); #endif @@ -78,7 +78,7 @@ MAKE_HOOK(CTFClientScoreBoardDialog_OnCommand, S::CTFClientScoreBoardDialog_OnCo void* rcx, const char* command) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::VGuiMenuBuilder_AddMenuItem.Map[DEFAULT_BIND]) + if (!Vars::Hooks::VGuiMenuBuilder_AddMenuItem[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, command); #endif diff --git a/Amalgam/src/Hooks/bf_read_ReadString.cpp b/Amalgam/src/Hooks/bf_read_ReadString.cpp index 6a2ec45f..a98e9728 100644 --- a/Amalgam/src/Hooks/bf_read_ReadString.cpp +++ b/Amalgam/src/Hooks/bf_read_ReadString.cpp @@ -9,7 +9,7 @@ MAKE_HOOK(bf_read_ReadString, S::bf_read_ReadString(), bool, void* rcx, char* pStr, int maxLen, bool bLine, int* pOutNumChars) { #ifdef DEBUG_HOOKS - if (!Vars::Hooks::bf_read_ReadString.Map[DEFAULT_BIND]) + if (!Vars::Hooks::bf_read_ReadString[DEFAULT_BIND]) return CALL_ORIGINAL(rcx, pStr, maxLen, bLine, pOutNumChars); #endif diff --git a/Amalgam/src/SDK/Definitions/Definitions.h b/Amalgam/src/SDK/Definitions/Definitions.h index 32bdc32c..899ed6b3 100644 --- a/Amalgam/src/SDK/Definitions/Definitions.h +++ b/Amalgam/src/SDK/Definitions/Definitions.h @@ -344,15 +344,16 @@ #define MAX_NETWORKID_LENGTH 64 #define SP_MODEL_INDEX_BITS 13 #define MAX_EDICT_BITS 11 -#define MAX_EDICTS (1<> NUM_ENT_ENTRY_BITS; + return m_Index >> NUM_SERIAL_NUM_SHIFT_BITS; } inline int CBaseHandle::ToInt() const diff --git a/Amalgam/src/SDK/Definitions/Misc/BSPFlags.h b/Amalgam/src/SDK/Definitions/Misc/BSPFlags.h index c6872c00..fc8403f7 100644 --- a/Amalgam/src/SDK/Definitions/Misc/BSPFlags.h +++ b/Amalgam/src/SDK/Definitions/Misc/BSPFlags.h @@ -55,6 +55,7 @@ #define CONTENTS_TRANSLUCENT 0x10000000 // auto set if any surface has trans #define CONTENTS_LADDER 0x20000000 #define CONTENTS_HITBOX 0x40000000 // use accurate hitboxes on trace +#define CONTENTS_NOSTARTSOLID 0x80000000 // don't skip entities or displacements when starting in solid // NOTE: These are stored in a short in the engine now. Don't use more than 16 bits diff --git a/Amalgam/src/SDK/Definitions/Types.h b/Amalgam/src/SDK/Definitions/Types.h index 12afed8d..f931dc04 100644 --- a/Amalgam/src/SDK/Definitions/Types.h +++ b/Amalgam/src/SDK/Definitions/Types.h @@ -1,4 +1,5 @@ #pragma once +#include #include #include #include @@ -12,192 +13,192 @@ public: float x = 0.f, y = 0.f; public: - void Zero() + inline void Zero() { x = y = 0.f; } - Vec2(float X = 0.f, float Y = 0.f) + inline Vec2(float X = 0.f, float Y = 0.f) { x = X; y = Y; } - Vec2(float* v) + inline Vec2(float* v) { x = v[0]; y = v[1]; } - Vec2(const float* v) + inline Vec2(const float* v) { x = v[0]; y = v[1]; } - Vec2(const Vec2& v) + inline Vec2(const Vec2& v) { x = v.x; y = v.y; } - Vec2& operator=(const Vec2& v) + inline Vec2& operator=(const Vec2& v) { x = v.x; y = v.y; return *this; } - float& operator[](int i) + inline float& operator[](int i) { return ((float*)this)[i]; } - float operator[](int i) const + inline float operator[](int i) const { return ((float*)this)[i]; } - bool operator==(const Vec2& v) const + inline bool operator==(const Vec2& v) const { return x == v.x && y == v.y; } - bool operator!=(const Vec2& v) const + inline bool operator!=(const Vec2& v) const { return x != v.x || y != v.y; } - Vec2& operator+=(const Vec2& v) + inline Vec2& operator+=(const Vec2& v) { x += v.x; y += v.y; return *this; } - Vec2& operator-=(const Vec2& v) + inline Vec2& operator-=(const Vec2& v) { x -= v.x; y -= v.y; return *this; } - Vec2& operator*=(const Vec2& v) + inline Vec2& operator*=(const Vec2& v) { x *= v.x; y *= v.y; return *this; } - Vec2& operator/=(const Vec2& v) + inline Vec2& operator/=(const Vec2& v) { x /= v.x; y /= v.y; return *this; } - Vec2& operator+=(float v) + inline Vec2& operator+=(float v) { x += v; y += v; return *this; } - Vec2& operator-=(float v) + inline Vec2& operator-=(float v) { x -= v; y -= v; return *this; } - Vec2& operator*=(float v) + inline Vec2& operator*=(float v) { x *= v; y *= v; return *this; } - Vec2& operator/=(float v) + inline Vec2& operator/=(float v) { x /= v; y /= v; return *this; } - Vec2 operator+(const Vec2& v) const + inline Vec2 operator+(const Vec2& v) const { return Vec2(x + v.x, y + v.y); } - Vec2 operator-(const Vec2& v) const + inline Vec2 operator-(const Vec2& v) const { return Vec2(x - v.x, y - v.y); } - Vec2 operator*(const Vec2& v) const + inline Vec2 operator*(const Vec2& v) const { return Vec2(x * v.x, y * v.y); } - Vec2 operator/(const Vec2& v) const + inline Vec2 operator/(const Vec2& v) const { return Vec2(x / v.x, y / v.y); } - Vec2 operator+(float v) const + inline Vec2 operator+(float v) const { return Vec2(x + v, y + v); } - Vec2 operator-(float v) const + inline Vec2 operator-(float v) const { return Vec2(x - v, y - v); } - Vec2 operator*(float v) const + inline Vec2 operator*(float v) const { return Vec2(x * v, y * v); } - Vec2 operator/(float v) const + inline Vec2 operator/(float v) const { return Vec2(x / v, y / v); } - void Set(float X = 0.f, float Y = 0.f) + inline void Set(float X = 0.f, float Y = 0.f) { x = X; y = Y; } - float Min() const + inline float Min() const { return std::min(x, y); } - float Max() const + inline float Max() const { return std::max(x, y); } - Vec2 Min(const Vec2& v) const + inline Vec2 Min(const Vec2& v) const { return Vec2(std::min(x, v.x), std::min(y, v.y)); } - Vec2 Max(const Vec2& v) const + inline Vec2 Max(const Vec2& v) const { return Vec2(std::max(x, v.x), std::max(y, v.y)); } - Vec2 Clamp(const Vec2& v1, const Vec2& v2) const + inline Vec2 Clamp(const Vec2& v1, const Vec2& v2) const { return Max(v1).Min(v2); } - Vec2 Min(float v) const + inline Vec2 Min(float v) const { return Vec2(std::min(x, v), std::min(y, v)); } - Vec2 Max(float v) const + inline Vec2 Max(float v) const { return Vec2(std::max(x, v), std::max(y, v)); } - Vec2 Clamp(float v1, float v2) const + inline Vec2 Clamp(float v1, float v2) const { return Max(v1).Min(v2); } - Vec2 Lerp(const Vec2& v, float t) const + inline Vec2 Lerp(const Vec2& v, float t) const { return { x + (v.x - x) * t, y + (v.y - y) * t }; } - Vec2 Lerp(float v, float t) const + inline Vec2 Lerp(float v, float t) const { return { x + (v - x) * t, y + (v - y) * t }; } - Vec2 DeltaAngle(const Vec2& v) const + inline Vec2 DeltaAngle(const Vec2& v) const { auto deltaAngle = [](const float flAngleA, const float flAngleB) { @@ -208,7 +209,7 @@ public: return { deltaAngle(x, v.x), deltaAngle(y, v.y) }; } - Vec2 DeltaAngle(float v) const + inline Vec2 DeltaAngle(float v) const { auto deltaAngle = [](const float flAngleA, const float flAngleB) { @@ -219,7 +220,7 @@ public: return { deltaAngle(x, v), deltaAngle(y, v) }; } - Vec2 LerpAngle(const Vec2& v, float t) const + inline Vec2 LerpAngle(const Vec2& v, float t) const { auto shortDist = [](const float flAngleA, const float flAngleB) { @@ -229,7 +230,7 @@ public: return { x - shortDist(x, v.x) * t, y - shortDist(y, v.y) * t }; } - Vec2 LerpAngle(float v, float t) const + inline Vec2 LerpAngle(float v, float t) const { auto shortDist = [](const float flAngleA, const float flAngleB) { @@ -239,32 +240,32 @@ public: return { x - shortDist(x, v) * t, y - shortDist(y, v) * t }; } - float Length(void) const + inline float Length(void) const { return sqrtf(x * x + y * y); } - float LengthSqr(void) const + inline float LengthSqr(void) const { return (x * x + y * y); } - float DistTo(const Vec2& v) const + inline float DistTo(const Vec2& v) const { return (*this - v).Length(); } - float DistToSqr(const Vec2& v) const + inline float DistToSqr(const Vec2& v) const { return (*this - v).LengthSqr(); } - float Dot(const Vec2& v) const + inline float Dot(const Vec2& v) const { return x * v.x + y * v.y; } - bool IsZero(void) const + inline bool IsZero(void) const { return fabsf(x) < 0.001f && fabsf(y) < 0.001f; @@ -278,197 +279,197 @@ public: float x = 0.f, y = 0.f, z = 0.f; public: - void Zero() + inline void Zero() { x = y = z = 0.f; } - Vec3(float X = 0.f, float Y = 0.f, float Z = 0.f) + inline Vec3(float X = 0.f, float Y = 0.f, float Z = 0.f) { x = X; y = Y; z = Z; } - Vec3(float* v) + inline Vec3(float* v) { x = v[0]; y = v[1]; z = v[2]; } - Vec3(const float* v) + inline Vec3(const float* v) { x = v[0]; y = v[1]; z = v[2]; } - Vec3(const Vec3& v) + inline Vec3(const Vec3& v) { x = v.x; y = v.y; z = v.z; } - Vec3(const Vec2& v) + inline Vec3(const Vec2& v) { x = v.x; y = v.y; z = 0.f; } - Vec3& operator=(const Vec3& v) + inline Vec3& operator=(const Vec3& v) { x = v.x; y = v.y; z = v.z; return *this; } - float& operator[](int i) + inline float& operator[](int i) { return ((float*)this)[i]; } - float operator[](int i) const + inline float operator[](int i) const { return ((float*)this)[i]; } - bool operator==(const Vec3& v) const + inline bool operator==(const Vec3& v) const { return x == v.x && y == v.y && z == v.z; } - bool operator!=(const Vec3& v) const + inline bool operator!=(const Vec3& v) const { return x != v.x || y != v.y || z != v.z; } - Vec3& operator+=(const Vec3& v) + inline Vec3& operator+=(const Vec3& v) { x += v.x; y += v.y; z += v.z; return *this; } - Vec3& operator-=(const Vec3& v) + inline Vec3& operator-=(const Vec3& v) { x -= v.x; y -= v.y; z -= v.z; return *this; } - Vec3& operator*=(const Vec3& v) + inline Vec3& operator*=(const Vec3& v) { x *= v.x; y *= v.y; z *= v.z; return *this; } - Vec3& operator/=(const Vec3& v) + inline Vec3& operator/=(const Vec3& v) { x /= v.x; y /= v.y; z /= v.z; return *this; } - Vec3& operator+=(float v) + inline Vec3& operator+=(float v) { x += v; y += v; z += v; return *this; } - Vec3& operator-=(float v) + inline Vec3& operator-=(float v) { x -= v; y -= v; z -= v; return *this; } - Vec3& operator*=(float v) + inline Vec3& operator*=(float v) { x *= v; y *= v; z *= v; return *this; } - Vec3& operator/=(float v) + inline Vec3& operator/=(float v) { x /= v; y /= v; z /= v; return *this; } - Vec3 operator+(const Vec3& v) const + inline Vec3 operator+(const Vec3& v) const { return Vec3(x + v.x, y + v.y, z + v.z); } - Vec3 operator-(const Vec3& v) const + inline Vec3 operator-(const Vec3& v) const { return Vec3(x - v.x, y - v.y, z - v.z); } - Vec3 operator*(const Vec3& v) const + inline Vec3 operator*(const Vec3& v) const { return Vec3(x * v.x, y * v.y, z * v.z); } - Vec3 operator/(const Vec3& v) const + inline Vec3 operator/(const Vec3& v) const { return Vec3(x / v.x, y / v.y, z / v.z); } - Vec3 operator+(float v) const + inline Vec3 operator+(float v) const { return Vec3(x + v, y + v, z + v); } - Vec3 operator-(float v) const + inline Vec3 operator-(float v) const { return Vec3(x - v, y - v, z - v); } - Vec3 operator*(float v) const + inline Vec3 operator*(float v) const { return Vec3(x * v, y * v, z * v); } - Vec3 operator/(float v) const + inline Vec3 operator/(float v) const { return Vec3(x / v, y / v, z / v); } - void Set(float X = 0.f, float Y = 0.f, float Z = 0.f) + inline void Set(float X = 0.f, float Y = 0.f, float Z = 0.f) { x = X; y = Y; z = Z; } - Vec3 Min(const Vec3& v) const + inline Vec3 Min(const Vec3& v) const { return Vec3(std::min(x, v.x), std::min(y, v.y), std::min(z, v.z)); } - Vec3 Max(const Vec3& v) const + inline Vec3 Max(const Vec3& v) const { return Vec3(std::max(x, v.x), std::max(y, v.y), std::max(z, v.z)); } - Vec3 Clamp(const Vec3& v1, const Vec3& v2) const + inline Vec3 Clamp(const Vec3& v1, const Vec3& v2) const { return Max(v1).Min(v2); } - float Min() const + inline float Min() const { return std::min(x, std::min(y, z)); } - float Max() const + inline float Max() const { return std::max(x, std::max(y, z)); } - Vec3 Min(float v) const + inline Vec3 Min(float v) const { return Vec3(std::min(x, v), std::min(y, v), std::min(z, v)); } - Vec3 Max(float v) const + inline Vec3 Max(float v) const { return Vec3(std::max(x, v), std::max(y, v), std::max(z, v)); } - Vec3 Clamp(float v1, float v2) const + inline Vec3 Clamp(float v1, float v2) const { return Max(v1).Min(v2); } - Vec3 Lerp(const Vec3& v, float t) const + inline Vec3 Lerp(const Vec3& v, float t) const { return { x + (v.x - x) * t, y + (v.y - y) * t, z + (v.z - z) * t }; } - Vec3 Lerp(float v, float t) const + inline Vec3 Lerp(float v, float t) const { return { x + (v - x) * t, y + (v - y) * t, z + (v - z) * t }; } - Vec3 DeltaAngle(const Vec3& v) const + inline Vec3 DeltaAngle(const Vec3& v) const { auto deltaAngle = [](const float flAngleA, const float flAngleB) { @@ -479,7 +480,7 @@ public: return { deltaAngle(x, v.x), deltaAngle(y, v.y), deltaAngle(z, v.z) }; } - Vec3 DeltaAngle(float v) const + inline Vec3 DeltaAngle(float v) const { auto deltaAngle = [](const float flAngleA, const float flAngleB) { @@ -490,7 +491,7 @@ public: return { deltaAngle(x, v), deltaAngle(y, v), deltaAngle(z, v) }; } - Vec3 LerpAngle(const Vec3& v, float t) const + inline Vec3 LerpAngle(const Vec3& v, float t) const { auto shortDist = [](const float flAngleA, const float flAngleB) { @@ -500,7 +501,7 @@ public: return { x - shortDist(x, v.x) * t, y - shortDist(y, v.y) * t, z - shortDist(z, v.z) * t }; } - Vec3 LerpAngle(float v, float t) const + inline Vec3 LerpAngle(float v, float t) const { auto shortDist = [](const float flAngleA, const float flAngleB) { @@ -510,17 +511,17 @@ public: return { x - shortDist(x, v) * t, y - shortDist(y, v) * t, z - shortDist(z, v) * t }; } - float Length(void) const + inline float Length(void) const { return sqrtf(x * x + y * y + z * z); } - float LengthSqr(void) const + inline float LengthSqr(void) const { return (x * x + y * y + z * z); } - float Normalize() + inline float Normalize() { float flLength = Length(); float flLengthNormal = 1.f / (FLT_EPSILON + flLength); @@ -532,71 +533,71 @@ public: return flLength; } - Vec3 Normalized() + inline Vec3 Normalized() { float flLengthNormal = 1.f / (FLT_EPSILON + Length()); return Vec3(x * flLengthNormal, y * flLengthNormal, z * flLengthNormal); } - Vec3 Get2D() + inline Vec3 Get2D() { return Vec3(x, y, 0); } - float Length2D(void) const + inline float Length2D(void) const { return sqrtf(x * x + y * y); } - float Length2DSqr(void) const + inline float Length2DSqr(void) const { return (x * x + y * y); } - float DistTo(const Vec3& v) const + inline float DistTo(const Vec3& v) const { return (*this - v).Length(); } - float DistToSqr(const Vec3& v) const + inline float DistToSqr(const Vec3& v) const { return (*this - v).LengthSqr(); } - float Dot(const Vec3& v) const + inline float Dot(const Vec3& v) const { return x * v.x + y * v.y + z * v.z; } - Vec3 Cross(const Vec3& v) const + inline Vec3 Cross(const Vec3& v) const { return Vec3(y * v.z - z * v.y, z * v.x - x * v.z, x * v.y - y * v.x); } - bool IsZero(void) const + inline bool IsZero(void) const { return fabsf(x) < 0.001f && fabsf(y) < 0.001f && fabsf(z) < 0.001f; } - Vec3 Scale(float fl) + inline Vec3 Scale(float fl) { return Vec3(x * fl, y * fl, z * fl); } - void Init(float ix, float iy, float iz) + inline void Init(float ix, float iy, float iz) { x = ix; y = iy; z = iz; } - Vec3 toAngle() const noexcept + inline Vec3 ToAngle() const noexcept { return { (atan2(-z, hypot(x, y))) * (180.f / 3.14159265358979323846f), (atan2(y, x)) * (180.f / 3.14159265358979323846f), 0.f }; } - Vec3 fromAngle() const noexcept + inline Vec3 FromAngle() const noexcept { return { cos(x * (3.14159265358979323846f / 180.f)) * cos(y * (3.14159265358979323846f / 180.f)), cos(x * (3.14159265358979323846f / 180.f)) * sin(y * (3.14159265358979323846f / 180.f)), @@ -631,12 +632,12 @@ struct IntRange_t { int Min = 0, Max = 0; - bool operator==(IntRange_t other) const + inline bool operator==(IntRange_t other) const { return Min == other.Min && Max == other.Max; } - bool operator!=(IntRange_t other) const + inline bool operator!=(IntRange_t other) const { return Min != other.Min || Max != other.Max; } @@ -646,51 +647,124 @@ struct FloatRange_t { float Min = 0, Max = 0; - bool operator==(FloatRange_t other) const + inline bool operator==(FloatRange_t other) const { return Min == other.Min && Max == other.Max; } - bool operator!=(FloatRange_t other) const + inline bool operator!=(FloatRange_t other) const { return Min != other.Min || Max != other.Max; } }; +namespace LerpEnum { + enum LerpEnum { + All, NoAlpha, Alpha + }; +}; using byte = unsigned char; struct Color_t { byte r = 255, g = 255, b = 255, a = 255; - bool operator==(Color_t other) const + inline void SetRGB(float flR = 255.f, float flG = 255.f, float flB = 255.f, float flA = 255.f) + { + r = byte(std::clamp(flR, 0.f, 255.f)); + g = byte(std::clamp(flG, 0.f, 255.f)); + b = byte(std::clamp(flB, 0.f, 255.f)); + a = byte(std::clamp(flA, 0.f, 255.f)); + } + + inline void SetHSV(float flH, float flS = 100.f, float flV = 100.f, float flA = 255.f) + { + float flR, flG, flB; + + flH = std::clamp(flH, 0.f, 360.f); + flS = std::clamp(flS, 0.f, 100.f); + flV = std::clamp(flV, 0.f, 100.f); + + flS /= 100; + flV /= 100; + if (!flS) + flR = flG = flB = flV; + else + { + int i = int(floor(flH /= 60)); + float flF = flH - i; + float flP = flV * (1 - flS); + float flQ = flV * (1 - flF * flS); + float flT = flV * (1 - (1 - flF) * flS); + + switch (i) + { + case 0: flR = flV; flG = flT; flB = flP; break; + case 1: flR = flQ; flG = flV; flB = flP; break; + case 2: flR = flP; flG = flV; flB = flT; break; + case 3: flR = flP; flG = flQ; flB = flV; break; + case 4: flR = flT; flG = flP; flB = flV; break; + default: flR = flV; flG = flP; flB = flQ; break; + } + } + + r = byte(std::clamp(flR * 255, 0.f, 255.f)); + g = byte(std::clamp(flG * 255, 0.f, 255.f)); + b = byte(std::clamp(flB * 255, 0.f, 255.f)); + a = byte(std::clamp(flA, 0.f, 255.f)); + } + + inline bool operator==(Color_t other) const { return r == other.r && g == other.g && b == other.b && a == other.a; } - bool operator!=(Color_t other) const + inline bool operator!=(Color_t other) const { return r != other.r || g != other.g || b != other.b || a != other.a; } - std::string ToHex() const + inline std::string ToHex() const { - return std::format("\x7{:02X}{:02X}{:02X}", r, g, b); + return std::format("\x7{:02x}{:02x}{:02x}", r, g, b); } - std::string ToHexA() const + inline std::string ToHexA() const { - return std::format("\x8{:02X}{:02X}{:02X}{:02X}", r, g, b, a); + return std::format("\x8{:02x}{:02x}{:02x}{:02x}", r, g, b, a); } - Color_t Lerp(Color_t to, float t, bool bAlpha = true) const + inline Color_t Lerp(Color_t to, float t, LerpEnum::LerpEnum eLerp = LerpEnum::All) const { //a + (b - a) * t - return { - byte(r + (to.r - r) * t), - byte(g + (to.g - g) * t), - byte(b + (to.b - b) * t), - byte(bAlpha ? a + (to.a - a) * t : a), - }; + switch (eLerp) + { + default: + return { + byte(r + (to.r - r) * t), + byte(g + (to.g - g) * t), + byte(b + (to.b - b) * t), + byte(a + (to.a - a) * t) + }; + case LerpEnum::NoAlpha: + return { + byte(r + (to.r - r) * t), + byte(g + (to.g - g) * t), + byte(b + (to.b - b) * t), + byte(a) + }; + case LerpEnum::Alpha: + return { + r, + g, + b, + byte(a + (to.a - a) * t) + }; + } + } + + inline Color_t Alpha(byte to) const + { + return { r, g, b, to }; } }; @@ -699,12 +773,12 @@ struct Gradient_t Color_t StartColor = {}; Color_t EndColor = {}; - bool operator==(Gradient_t other) const + inline bool operator==(Gradient_t other) const { return StartColor == other.StartColor && EndColor == other.EndColor; } - bool operator!=(Gradient_t other) const + inline bool operator!=(Gradient_t other) const { return StartColor != other.StartColor || EndColor != other.EndColor; } @@ -721,7 +795,7 @@ struct Glow_t int Stencil = 0; int Blur = 0; - bool operator==(const Glow_t& other) const + inline bool operator==(const Glow_t& other) const { return Stencil == other.Stencil && Blur == other.Blur; } @@ -732,12 +806,12 @@ struct DragBox_t int x = 150; int y = 100; - bool operator==(DragBox_t other) const + inline bool operator==(DragBox_t other) const { return x == other.x && y == other.y; } - bool operator!=(DragBox_t other) const + inline bool operator!=(DragBox_t other) const { return x != other.x || y != other.y; } @@ -750,12 +824,12 @@ struct WindowBox_t int w = 200; int h = 200; - bool operator==(WindowBox_t other) const + inline bool operator==(WindowBox_t other) const { return x == other.x && y == other.y && w == other.w && h == other.h; } - bool operator!=(WindowBox_t other) const + inline bool operator!=(WindowBox_t other) const { return x != other.x || y != other.y || w != other.w || h != other.h; } diff --git a/Amalgam/src/SDK/Helpers/TraceFilters/TraceFilters.cpp b/Amalgam/src/SDK/Helpers/TraceFilters/TraceFilters.cpp index d2395804..b15dfa4e 100644 --- a/Amalgam/src/SDK/Helpers/TraceFilters/TraceFilters.cpp +++ b/Amalgam/src/SDK/Helpers/TraceFilters/TraceFilters.cpp @@ -72,6 +72,7 @@ bool CTraceFilterProjectile::ShouldHitEntity(IHandleEntity* pServerEntity, int n case ETFClassID::CBaseDoor: case ETFClassID::CDynamicProp: case ETFClassID::CPhysicsProp: + case ETFClassID::CPhysicsPropMultiplayer: case ETFClassID::CObjectCartDispenser: case ETFClassID::CFuncTrackTrain: case ETFClassID::CFuncConveyor: @@ -121,6 +122,7 @@ bool CTraceFilterWorldAndPropsOnly::ShouldHitEntity(IHandleEntity* pServerEntity case ETFClassID::CBaseDoor: case ETFClassID::CDynamicProp: case ETFClassID::CPhysicsProp: + case ETFClassID::CPhysicsPropMultiplayer: case ETFClassID::CObjectCartDispenser: case ETFClassID::CFuncTrackTrain: case ETFClassID::CFuncConveyor: return true; @@ -135,9 +137,12 @@ bool CTraceFilterWorldAndPropsOnly::ShouldHitEntity(IHandleEntity* pServerEntity } } + if (pServerEntity->GetRefEHandle().GetSerialNumber() == (1 << 15)) + return I::ClientEntityList->GetClientEntity(0) != pSkip; + return false; } TraceType_t CTraceFilterWorldAndPropsOnly::GetTraceType() const { - return TRACE_EVERYTHING; + return TRACE_EVERYTHING_FILTER_PROPS; } \ No newline at end of file diff --git a/Amalgam/src/SDK/SDK.cpp b/Amalgam/src/SDK/SDK.cpp index a5b2cb6e..8146dc0a 100644 --- a/Amalgam/src/SDK/SDK.cpp +++ b/Amalgam/src/SDK/SDK.cpp @@ -568,7 +568,7 @@ int SDK::IsAttacking(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, const CUserCmd* static auto tf_grapplinghook_max_distance = U::ConVars.FindVar("tf_grapplinghook_max_distance"); const float flGrappleDistance = tf_grapplinghook_max_distance ? tf_grapplinghook_max_distance->GetFloat() : 2000.f; Trace(vPos, vPos + vForward * flGrappleDistance, MASK_SOLID, &filter, &trace); - return trace.DidHit() && !(trace.surface.flags & 0x0004 /*SURF_SKY*/); + return trace.DidHit() && !(trace.surface.flags & SURF_SKY); } case TF_WEAPON_MINIGUN: switch (pWeapon->As()->m_iWeaponState()) @@ -661,18 +661,18 @@ bool SDK::StopMovement(CTFPlayer* pLocal, CUserCmd* pCmd) if (G::Attacking != 1) { - const float direction = Math::VelocityToAngles(pLocal->m_vecVelocity() * -1).y; - pCmd->viewangles = { 90, direction, 0 }; + float flDirection = Math::VelocityToAngles(pLocal->m_vecVelocity() * -1).y; + pCmd->viewangles = { 90, flDirection, 0 }; pCmd->sidemove = 0; pCmd->forwardmove = 0; return true; } else { - Vec3 direction = pLocal->m_vecVelocity().toAngle(); - direction.y = pCmd->viewangles.y - direction.y; - const Vec3 negatedDirection = direction.fromAngle() * -pLocal->m_vecVelocity().Length2D(); - pCmd->forwardmove = negatedDirection.x; - pCmd->sidemove = negatedDirection.y; + Vec3 vDirection = pLocal->m_vecVelocity().ToAngle(); + vDirection.y = pCmd->viewangles.y - vDirection.y; + Vec3 vNegatedDirection = vDirection.FromAngle() * -pLocal->m_vecVelocity().Length2D(); + pCmd->forwardmove = vNegatedDirection.x; + pCmd->sidemove = vNegatedDirection.y; return false; } } diff --git a/Amalgam/src/SDK/Vars.h b/Amalgam/src/SDK/Vars.h index 22c691cb..27f8abc4 100644 --- a/Amalgam/src/SDK/Vars.h +++ b/Amalgam/src/SDK/Vars.h @@ -38,6 +38,15 @@ public: T Value; std::unordered_map Map; ConfigVar(T value, std::string name, int iFlags = 0); + + inline T& operator[](int i) + { + return Map[i]; + } + inline bool contains(int i) const + { + return Map.contains(i); + } }; inline std::vector g_Vars; @@ -91,7 +100,7 @@ namespace Vars CVar(MenuSecondaryKey, VK_F3, NOBIND) CVar(BindWindowTitle, true) - CVar(BindsDisplay, DragBox_t(), NOBIND) + CVar(BindsDisplay, DragBox_t(100, 100), NOBIND) CVar(MenuShowsBinds, false, NOBIND) CVarEnum(Indicators, 0b00000, NONE, Ticks = 1 << 0, CritHack = 1 << 1, Spectators = 1 << 2, Ping = 1 << 3, Conditions = 1 << 4, SeedPrediction = 1 << 5) @@ -115,6 +124,69 @@ namespace Vars SUBNAMESPACE_END(Theme) NAMESPACE_END(Menu) + NAMESPACE_BEGIN(Colors) + CVar(FOVCircle, Color_t(255, 255, 255, 100), VISUAL) + CVar(Relative, false, VISUAL) + CVar(TeamRed, Color_t(225, 60, 60, 255), VISUAL) + CVar(TeamBlu, Color_t(75, 175, 225, 255), VISUAL) + CVar(Enemy, Color_t(225, 60, 60, 255), VISUAL) + CVar(Team, Color_t(75, 175, 225, 255), VISUAL) + CVar(Local, Color_t(255, 255, 255, 255), VISUAL) + CVar(Target, Color_t(255, 0, 0, 255), VISUAL) + CVar(Health, Color_t(0, 225, 75, 255), VISUAL) + CVar(Ammo, Color_t(127, 127, 127, 255), VISUAL) + CVar(Money, Color_t(0, 150, 75, 255), VISUAL) + CVar(Powerup, Color_t(255, 175, 0, 255), VISUAL) + CVar(NPC, Color_t(255, 255, 255, 255), VISUAL) + CVar(Halloween, Color_t(100, 0, 255, 255), VISUAL) + CVar(Backtrack, Color_t(255, 0, 0, 0), VISUAL) + CVar(FakeAngle, Color_t(255, 255, 255, 0), VISUAL) + + CVar(IndicatorGood, Color_t(0, 255, 100, 255), DEBUGVAR) + CVar(IndicatorMid, Color_t(255, 200, 0, 255), DEBUGVAR) + CVar(IndicatorBad, Color_t(255, 0, 0, 255), DEBUGVAR) + CVar(IndicatorMisc, Color_t(75, 175, 255, 255), DEBUGVAR) + CVar(IndicatorTextGood, Color_t(150, 255, 150, 255), DEBUGVAR) + CVar(IndicatorTextMid, Color_t(255, 200, 0, 255), DEBUGVAR) + CVar(IndicatorTextBad, Color_t(255, 150, 150, 255), DEBUGVAR) + CVar(IndicatorTextMisc, Color_t(100, 255, 255, 255), DEBUGVAR) + + CVar(WorldModulation, Color_t(255, 255, 255, 255), VISUAL) + CVar(SkyModulation, Color_t(255, 255, 255, 255), VISUAL) + CVar(PropModulation, Color_t(255, 255, 255, 255), VISUAL) + CVar(ParticleModulation, Color_t(255, 255, 255, 255), VISUAL) + CVar(FogModulation, Color_t(255, 255, 255, 255), VISUAL) + + CVar(Line, Color_t(255, 255, 255, 0), VISUAL) + CVar(LineClipped, Color_t(255, 255, 255, 255), VISUAL) + + CVar(PlayerPath, Color_t(255, 255, 255, 255), VISUAL) + CVar(PlayerPathClipped, Color_t(255, 255, 255, 0), VISUAL) + CVar(ProjectilePath, Color_t(255, 255, 255, 255), VISUAL) + CVar(ProjectilePathClipped, Color_t(255, 255, 255, 0), VISUAL) + CVar(TrajectoryPath, Color_t(255, 255, 255, 255), VISUAL) + CVar(TrajectoryPathClipped, Color_t(255, 255, 255, 0), VISUAL) + CVar(ShotPath, Color_t(255, 255, 255, 255), VISUAL) + CVar(ShotPathClipped, Color_t(255, 255, 255, 0), VISUAL) + CVar(SplashRadius, Color_t(255, 255, 255, 255), VISUAL) + CVar(SplashRadiusClipped, Color_t(255, 255, 255, 0), VISUAL) + + CVar(BoneHitboxEdge, Color_t(255, 255, 255, 0), VISUAL) + CVar(BoneHitboxEdgeClipped, Color_t(255, 255, 255, 255), VISUAL) + CVar(BoneHitboxFace, Color_t(255, 255, 255, 0), VISUAL) + CVar(BoneHitboxFaceClipped, Color_t(255, 255, 255, 0), VISUAL) + CVar(TargetHitboxEdge, Color_t(255, 150, 150, 0), VISUAL) + CVar(TargetHitboxEdgeClipped, Color_t(255, 150, 150, 255), VISUAL) + CVar(TargetHitboxFace, Color_t(255, 150, 150, 0), VISUAL) + CVar(TargetHitboxFaceClipped, Color_t(255, 150, 150, 0), VISUAL) + CVar(BoundHitboxEdge, Color_t(255, 255, 255, 0), VISUAL) + CVar(BoundHitboxEdgeClipped, Color_t(255, 255, 255, 255), VISUAL) + CVar(BoundHitboxFace, Color_t(255, 255, 255, 0), VISUAL) + CVar(BoundHitboxFaceClipped, Color_t(255, 255, 255, 0), VISUAL) + + CVar(SpellFootstep, Color_t(255, 255, 255, 255), VISUAL) + NAMESPACE_END(Colors) + NAMESPACE_BEGIN(Aimbot) SUBNAMESPACE_BEGIN(General) CVarEnum(AimType, 0, NONE, Off, Plain, Smooth, Silent, Locking, Assistive) @@ -192,8 +264,9 @@ namespace Vars CVar(HuntsmanPullPoint, false, DEBUGVAR) CVar(SplashPoints, 100, DEBUGVAR) CVar(SplashGrates, true, DEBUGVAR) + CVar(SplashRotateX, 0.f, DEBUGVAR) + CVar(SplashRotateY, 0.f, DEBUGVAR) CVar(SplashNthRoot, 1.f, DEBUGVAR) - CVar(SplashRotate, 0.f, DEBUGVAR) CVar(SplashCountDirect, 100, DEBUGVAR) CVar(SplashCountArc, 5, DEBUGVAR) CVar(SplashTraceInterval, 10, DEBUGVAR) @@ -369,6 +442,7 @@ namespace Vars SUBNAMESPACE_BEGIN(Backtrack) CVar(Enabled, false, VISUAL) + CVar(IgnoreZ, false, VISUAL) CVarEnum(Draw, 0b0, VISUAL, Last, LastFirst, All) CVar(Visible, VA_LIST(std::vector>) VA_LIST({ { "Original", {} } }), VISUAL) @@ -377,6 +451,7 @@ namespace Vars SUBNAMESPACE_BEGIN(FakeAngle) CVar(Enabled, false, VISUAL) + CVar(IgnoreZ, false, VISUAL) CVar(Visible, VA_LIST(std::vector>) VA_LIST({ { "Original", {} } }), VISUAL) //CVar(Occluded, VA_LIST(std::vector>) {}, VISUAL) // unused @@ -781,67 +856,6 @@ namespace Vars SUBNAMESPACE_END(Steam) NAMESPACE_END(Misc) - NAMESPACE_BEGIN(Colors) - CVar(FOVCircle, Color_t(255, 255, 255, 100), VISUAL) - CVar(Relative, false, VISUAL) - CVar(TeamRed, Color_t(225, 60, 60, 255), VISUAL) - CVar(TeamBlu, Color_t(75, 175, 225, 255), VISUAL) - CVar(Enemy, Color_t(225, 60, 60, 255), VISUAL) - CVar(Team, Color_t(75, 175, 225, 255), VISUAL) - CVar(Local, Color_t(255, 255, 255, 255), VISUAL) - CVar(Target, Color_t(255, 0, 0, 255), VISUAL) - CVar(Health, Color_t(0, 225, 75, 255), VISUAL) - CVar(Ammo, Color_t(127, 127, 127, 255), VISUAL) - CVar(Money, Color_t(0, 150, 75, 255), VISUAL) - CVar(Powerup, Color_t(255, 175, 0, 255), VISUAL) - CVar(NPC, Color_t(255, 255, 255, 255), VISUAL) - CVar(Halloween, Color_t(100, 0, 255, 255), VISUAL) - - CVar(IndicatorGood, Color_t(0, 255, 100, 255), DEBUGVAR) - CVar(IndicatorMid, Color_t(255, 200, 0, 255), DEBUGVAR) - CVar(IndicatorBad, Color_t(255, 0, 0, 255), DEBUGVAR) - CVar(IndicatorMisc, Color_t(75, 175, 255, 255), DEBUGVAR) - CVar(IndicatorTextGood, Color_t(150, 255, 150, 255), DEBUGVAR) - CVar(IndicatorTextMid, Color_t(255, 200, 0, 255), DEBUGVAR) - CVar(IndicatorTextBad, Color_t(255, 150, 150, 255), DEBUGVAR) - CVar(IndicatorTextMisc, Color_t(100, 255, 255, 255), DEBUGVAR) - - CVar(WorldModulation, Color_t(255, 255, 255, 255), VISUAL) - CVar(SkyModulation, Color_t(255, 255, 255, 255), VISUAL) - CVar(PropModulation, Color_t(255, 255, 255, 255), VISUAL) - CVar(ParticleModulation, Color_t(255, 255, 255, 255), VISUAL) - CVar(FogModulation, Color_t(255, 255, 255, 255), VISUAL) - - CVar(Line, Color_t(255, 255, 255, 0), VISUAL) - CVar(LineClipped, Color_t(255, 255, 255, 255), VISUAL) - - CVar(PlayerPath, Color_t(255, 255, 255, 255), VISUAL) - CVar(PlayerPathClipped, Color_t(255, 255, 255, 0), VISUAL) - CVar(ProjectilePath, Color_t(255, 255, 255, 255), VISUAL) - CVar(ProjectilePathClipped, Color_t(255, 255, 255, 0), VISUAL) - CVar(TrajectoryPath, Color_t(255, 255, 255, 255), VISUAL) - CVar(TrajectoryPathClipped, Color_t(255, 255, 255, 0), VISUAL) - CVar(ShotPath, Color_t(255, 255, 255, 255), VISUAL) - CVar(ShotPathClipped, Color_t(255, 255, 255, 0), VISUAL) - CVar(SplashRadius, Color_t(255, 255, 255, 255), VISUAL) - CVar(SplashRadiusClipped, Color_t(255, 255, 255, 0), VISUAL) - - CVar(BoneHitboxEdge, Color_t(255, 255, 255, 0), VISUAL) - CVar(BoneHitboxEdgeClipped, Color_t(255, 255, 255, 255), VISUAL) - CVar(BoneHitboxFace, Color_t(255, 255, 255, 0), VISUAL) - CVar(BoneHitboxFaceClipped, Color_t(255, 255, 255, 0), VISUAL) - CVar(TargetHitboxEdge, Color_t(255, 150, 150, 0), VISUAL) - CVar(TargetHitboxEdgeClipped, Color_t(255, 150, 150, 255), VISUAL) - CVar(TargetHitboxFace, Color_t(255, 150, 150, 0), VISUAL) - CVar(TargetHitboxFaceClipped, Color_t(255, 150, 150, 0), VISUAL) - CVar(BoundHitboxEdge, Color_t(255, 255, 255, 0), VISUAL) - CVar(BoundHitboxEdgeClipped, Color_t(255, 255, 255, 255), VISUAL) - CVar(BoundHitboxFace, Color_t(255, 255, 255, 0), VISUAL) - CVar(BoundHitboxFaceClipped, Color_t(255, 255, 255, 0), VISUAL) - - CVar(SpellFootstep, Color_t(255, 255, 255, 255), VISUAL) - NAMESPACE_END(Colors) - NAMESPACE_BEGIN(Logging) CVarEnum(Logs, 0b0000011, NONE, VoteStart = 1 << 0, VoteCast = 1 << 1, ClassChanges = 1 << 2, Damage = 1 << 3, CheatDetection = 1 << 4, Tags = 1 << 5, Aliases = 1 << 6, Resolver = 1 << 7) Enum(LogTo, Toasts = 1 << 0, Chat = 1 << 1, Party = 1 << 2, Console = 1 << 3, Menu = 1 << 4, Debug = 1 << 5) @@ -914,6 +928,7 @@ namespace Vars CVar(CBasePlayer_CalcViewModelView, true, NOSAVE) CVar(CBasePlayer_ItemPostFrame, true, NOSAVE) CVar(CBaseViewModel_ShouldFlipViewModel, true, NOSAVE) + CVar(Cbuf_ExecuteCommand, true, NOSAVE) CVar(CClientModeShared_CreateMove, true, NOSAVE) CVar(CClientModeShared_DoPostScreenSpaceEffects, true, NOSAVE) CVar(CClientModeShared_OverrideView, true, NOSAVE) @@ -978,6 +993,7 @@ namespace Vars CVar(IBaseClientDLL_DispatchUserMessage, true, NOSAVE) CVar(IBaseClientDLL_FrameStageNotify, true, NOSAVE) CVar(IBaseClientDLL_LevelShutdown, true, NOSAVE) + CVar(IEngineTrace_SetTraceEntity, true, NOSAVE) CVar(IEngineTrace_TraceRay, true, NOSAVE) CVar(IEngineVGui_Paint, true, NOSAVE) CVar(IInput_GetUserCmd, true, NOSAVE)