From 677b21e319844d1afee752fb149eec58dc2b972e Mon Sep 17 00:00:00 2001 From: rei-2 <174158077+rei-2@users.noreply.github.com> Date: Thu, 23 Oct 2025 20:45:44 -0400 Subject: [PATCH] update entitycache enum comment out currently unused groups in entitycache --- Amalgam/cpp.hint | 18 ++++- .../Aimbot/AimbotHitscan/AimbotHitscan.cpp | 16 ++-- .../Aimbot/AimbotMelee/AimbotMelee.cpp | 14 ++-- .../AimbotProjectile/AimbotProjectile.cpp | 18 ++--- .../Aimbot/AutoAirblast/AutoAirblast.cpp | 2 +- .../Aimbot/AutoDetonate/AutoDetonate.cpp | 28 +++---- .../Aimbot/AutoDetonate/AutoDetonate.h | 4 +- .../src/Features/Aimbot/AutoHeal/AutoHeal.cpp | 8 +- Amalgam/src/Features/Backtrack/Backtrack.cpp | 4 +- .../CheaterDetection/CheaterDetection.cpp | 2 +- .../EnginePrediction/EnginePrediction.cpp | 2 +- Amalgam/src/Features/Misc/Misc.cpp | 2 +- .../Features/PacketManip/AntiAim/AntiAim.cpp | 2 +- Amalgam/src/Features/Resolver/Resolver.cpp | 6 +- .../MovementSimulation/MovementSimulation.cpp | 4 +- Amalgam/src/Features/Visuals/ESP/ESP.cpp | 2 +- Amalgam/src/Features/Visuals/Visuals.cpp | 8 +- ...CBaseHudChatLine_InsertAndColorizeText.cpp | 2 +- .../src/Hooks/CParticleProperty_Create.cpp | 2 +- .../Hooks/CWeaponMedigun_PrimaryAttack.cpp | 2 +- Amalgam/src/SDK/Helpers/Entities/Entities.cpp | 74 +++++++++---------- Amalgam/src/SDK/Helpers/Entities/Entities.h | 21 +++--- Amalgam/src/Utils/Macros/Macros.h | 16 ++-- 23 files changed, 133 insertions(+), 124 deletions(-) diff --git a/Amalgam/cpp.hint b/Amalgam/cpp.hint index 7f7ddd66..30144ae3 100644 --- a/Amalgam/cpp.hint +++ b/Amalgam/cpp.hint @@ -1,3 +1,16 @@ +#define VA_LIST(...) __VA_ARGS__ + +#define STRINGIFY(x) STRINGIFY2(x) +#define STRINGIFY2(x) #x +#define __LINESTRING__ STRINGIFY(__LINE__) + +#define ADD_FEATURE_CUSTOM(type, name, scope) namespace scope { inline type name; } +#define ADD_FEATURE(type, name) ADD_FEATURE_CUSTOM(type, name, F) + +#define Assert(cond) if (!cond) { MessageBox(0, #cond "\n\n" __FUNCSIG__ " Line " __LINESTRING__, "Error", MB_OK | MB_ICONERROR); } +#define AssertFatal(cond) if (!cond) { MessageBox(0, #cond "\n\n" __FUNCSIG__ " Line " __LINESTRING__, "Error", MB_OK | MB_ICONERROR); exit(EXIT_FAILURE); } +#define AssertCustom(cond, message) if (!cond) { MessageBox(0, message, "Error", MB_OK | MB_ICONERROR); } + #define TICK_INTERVAL I::GlobalVars->interval_per_tick #define TIME_TO_TICKS(dt) (static_cast(0.5f + static_cast(dt) / TICK_INTERVAL)) #define TICKS_TO_TIME(t) (TICK_INTERVAL * (t)) @@ -126,7 +139,4 @@ namespace MAKE_INTERFACE_SCOPE \ #define DROPDOWN_CUSTOM (1 << 2) #define DROPDOWN_AUTOUPDATE (1 << 3) -#define DEFAULT_BIND -1 - -#define ADD_FEATURE_CUSTOM(type, name, scope) namespace scope { inline type name; } -#define ADD_FEATURE(type, name) ADD_FEATURE_CUSTOM(type, name, F) \ No newline at end of file +#define DEFAULT_BIND -1 \ No newline at end of file diff --git a/Amalgam/src/Features/Aimbot/AimbotHitscan/AimbotHitscan.cpp b/Amalgam/src/Features/Aimbot/AimbotHitscan/AimbotHitscan.cpp index ea9998c5..ef90e72f 100644 --- a/Amalgam/src/Features/Aimbot/AimbotHitscan/AimbotHitscan.cpp +++ b/Amalgam/src/Features/Aimbot/AimbotHitscan/AimbotHitscan.cpp @@ -15,16 +15,16 @@ std::vector CAimbotHitscan::GetTargets(CTFPlayer* pLocal, CTFWeaponBas Vec3 vLocalAngles = I::EngineClient->GetViewAngles(); { - auto eGroupType = EGroupType::GROUP_INVALID; + auto eGroupType = EntityEnum::Invalid; if (Vars::Aimbot::General::Target.Value & Vars::Aimbot::General::TargetEnum::Players) { - eGroupType = !F::AimbotGlobal.FriendlyFire() || Vars::Aimbot::General::Ignore.Value & Vars::Aimbot::General::IgnoreEnum::Team ? EGroupType::PLAYERS_ENEMIES : EGroupType::PLAYERS_ALL; + eGroupType = !F::AimbotGlobal.FriendlyFire() || Vars::Aimbot::General::Ignore.Value & Vars::Aimbot::General::IgnoreEnum::Team ? EntityEnum::PlayerEnemy : EntityEnum::PlayerAll; if (Vars::Aimbot::Hitscan::Modifiers.Value & Vars::Aimbot::Hitscan::ModifiersEnum::ExtinguishTeam && !F::AimbotGlobal.FriendlyFire() && SDK::AttribHookValue(0, "jarate_duration", pWeapon) > 0) - eGroupType = EGroupType::PLAYERS_ALL; + eGroupType = EntityEnum::PlayerAll; } if (pWeapon->GetWeaponID() == TF_WEAPON_MEDIGUN) - eGroupType = Vars::Aimbot::Healing::AutoHeal.Value ? EGroupType::PLAYERS_TEAMMATES : EGroupType::GROUP_INVALID; + eGroupType = Vars::Aimbot::Healing::AutoHeal.Value ? EntityEnum::PlayerTeam : EntityEnum::Invalid; bool bHeal = pWeapon->GetWeaponID() == TF_WEAPON_MEDIGUN; for (auto pEntity : H::Entities.GetGroup(eGroupType)) @@ -78,7 +78,7 @@ std::vector CAimbotHitscan::GetTargets(CTFPlayer* pLocal, CTFWeaponBas if (Vars::Aimbot::General::Target.Value & Vars::Aimbot::General::TargetEnum::Building) { - for (auto pEntity : H::Entities.GetGroup(EGroupType::BUILDINGS_ENEMIES)) + for (auto pEntity : H::Entities.GetGroup(EntityEnum::BuildingEnemy)) { if (F::AimbotGlobal.ShouldIgnore(pEntity, pLocal, pWeapon)) continue; @@ -96,7 +96,7 @@ std::vector CAimbotHitscan::GetTargets(CTFPlayer* pLocal, CTFWeaponBas if (Vars::Aimbot::General::Target.Value & Vars::Aimbot::General::TargetEnum::Stickies) { - for (auto pEntity : H::Entities.GetGroup(EGroupType::WORLD_PROJECTILES)) + for (auto pEntity : H::Entities.GetGroup(EntityEnum::WorldProjectile)) { if (F::AimbotGlobal.ShouldIgnore(pEntity, pLocal, pWeapon)) continue; @@ -114,7 +114,7 @@ std::vector CAimbotHitscan::GetTargets(CTFPlayer* pLocal, CTFWeaponBas if (Vars::Aimbot::General::Target.Value & Vars::Aimbot::General::TargetEnum::NPCs) { - for (auto pEntity : H::Entities.GetGroup(EGroupType::WORLD_NPC)) + for (auto pEntity : H::Entities.GetGroup(EntityEnum::WorldNPC)) { if (F::AimbotGlobal.ShouldIgnore(pEntity, pLocal, pWeapon)) continue; @@ -132,7 +132,7 @@ std::vector CAimbotHitscan::GetTargets(CTFPlayer* pLocal, CTFWeaponBas if (Vars::Aimbot::General::Target.Value & Vars::Aimbot::General::TargetEnum::Bombs) { - for (auto pEntity : H::Entities.GetGroup(EGroupType::WORLD_BOMBS)) + for (auto pEntity : H::Entities.GetGroup(EntityEnum::WorldBomb)) { Vec3 vPos = pEntity->GetCenter(); Vec3 vAngleTo = Math::CalcAngle(vLocalPos, vPos); diff --git a/Amalgam/src/Features/Aimbot/AimbotMelee/AimbotMelee.cpp b/Amalgam/src/Features/Aimbot/AimbotMelee/AimbotMelee.cpp index a3ace5ba..78172356 100644 --- a/Amalgam/src/Features/Aimbot/AimbotMelee/AimbotMelee.cpp +++ b/Amalgam/src/Features/Aimbot/AimbotMelee/AimbotMelee.cpp @@ -15,10 +15,10 @@ std::vector CAimbotMelee::GetTargets(CTFPlayer* pLocal, CTFWeaponBase* if (Vars::Aimbot::General::Target.Value & Vars::Aimbot::General::TargetEnum::Players) { - auto eGroupType = !F::AimbotGlobal.FriendlyFire() || Vars::Aimbot::General::Ignore.Value & Vars::Aimbot::General::IgnoreEnum::Team ? EGroupType::PLAYERS_ENEMIES : EGroupType::PLAYERS_ALL; + auto eGroupType = !F::AimbotGlobal.FriendlyFire() || Vars::Aimbot::General::Ignore.Value & Vars::Aimbot::General::IgnoreEnum::Team ? EntityEnum::PlayerEnemy : EntityEnum::PlayerAll; if (Vars::Aimbot::Melee::WhipTeam.Value && !F::AimbotGlobal.FriendlyFire() && SDK::AttribHookValue(0, "speed_buff_ally", pWeapon) > 0) - eGroupType = EGroupType::PLAYERS_ALL; + eGroupType = EntityEnum::PlayerAll; for (auto pEntity : H::Entities.GetGroup(eGroupType)) { @@ -40,12 +40,12 @@ std::vector CAimbotMelee::GetTargets(CTFPlayer* pLocal, CTFWeaponBase* } { - auto eGroupType = EGroupType::GROUP_INVALID; + auto eGroupType = EntityEnum::Invalid; if (Vars::Aimbot::General::Target.Value & Vars::Aimbot::General::TargetEnum::Building) - eGroupType = EGroupType::BUILDINGS_ENEMIES; + eGroupType = EntityEnum::BuildingEnemy; bool bWrench = pWeapon->GetWeaponID() == TF_WEAPON_WRENCH, bSapper = SDK::AttribHookValue(0, "set_dmg_apply_to_sapper", pWeapon); if (Vars::Aimbot::Healing::AutoRepair.Value && (bWrench || bSapper)) - eGroupType = eGroupType != EGroupType::GROUP_INVALID ? EGroupType::BUILDINGS_ALL : EGroupType::BUILDINGS_TEAMMATES; + eGroupType = eGroupType != EntityEnum::Invalid ? EntityEnum::BuildingAll : EntityEnum::BuildingTeam; for (auto pEntity : H::Entities.GetGroup(eGroupType)) { if (F::AimbotGlobal.ShouldIgnore(pEntity, pLocal, pWeapon)) @@ -83,7 +83,7 @@ std::vector CAimbotMelee::GetTargets(CTFPlayer* pLocal, CTFWeaponBase* if (Vars::Aimbot::General::Target.Value & Vars::Aimbot::General::TargetEnum::NPCs) { - for (auto pEntity : H::Entities.GetGroup(EGroupType::WORLD_NPC)) + for (auto pEntity : H::Entities.GetGroup(EntityEnum::WorldNPC)) { if (F::AimbotGlobal.ShouldIgnore(pEntity, pLocal, pWeapon)) continue; @@ -662,7 +662,7 @@ bool CAimbotMelee::RunSapper(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCmd const Vec3 vLocalAngles = I::EngineClient->GetViewAngles(); std::vector vTargets; - for (auto pEntity : H::Entities.GetGroup(EGroupType::BUILDINGS_ENEMIES)) + for (auto pEntity : H::Entities.GetGroup(EntityEnum::BuildingEnemy)) { auto pBuilding = pEntity->As(); if (pBuilding->m_bHasSapper() || !pBuilding->IsInValidTeam()) diff --git a/Amalgam/src/Features/Aimbot/AimbotProjectile/AimbotProjectile.cpp b/Amalgam/src/Features/Aimbot/AimbotProjectile/AimbotProjectile.cpp index 94ec6507..1a0df2ac 100644 --- a/Amalgam/src/Features/Aimbot/AimbotProjectile/AimbotProjectile.cpp +++ b/Amalgam/src/Features/Aimbot/AimbotProjectile/AimbotProjectile.cpp @@ -28,18 +28,18 @@ std::vector CAimbotProjectile::GetTargets(CTFPlayer* pLocal, CTFWeapon const Vec3 vLocalAngles = I::EngineClient->GetViewAngles(); { - auto eGroupType = EGroupType::GROUP_INVALID; + auto eGroupType = EntityEnum::Invalid; if (Vars::Aimbot::General::Target.Value & Vars::Aimbot::General::TargetEnum::Players) - eGroupType = !F::AimbotGlobal.FriendlyFire() || Vars::Aimbot::General::Ignore.Value & Vars::Aimbot::General::IgnoreEnum::Team ? EGroupType::PLAYERS_ENEMIES : EGroupType::PLAYERS_ALL; + eGroupType = !F::AimbotGlobal.FriendlyFire() || Vars::Aimbot::General::Ignore.Value & Vars::Aimbot::General::IgnoreEnum::Team ? EntityEnum::PlayerEnemy : EntityEnum::PlayerAll; switch (pWeapon->GetWeaponID()) { case TF_WEAPON_CROSSBOW: if (Vars::Aimbot::Healing::AutoArrow.Value) - eGroupType = eGroupType != EGroupType::GROUP_INVALID ? EGroupType::PLAYERS_ALL : EGroupType::PLAYERS_TEAMMATES; + eGroupType = eGroupType != EntityEnum::Invalid ? EntityEnum::PlayerAll : EntityEnum::PlayerTeam; break; case TF_WEAPON_LUNCHBOX: if (Vars::Aimbot::Healing::AutoSandvich.Value) - eGroupType = EGroupType::PLAYERS_TEAMMATES; + eGroupType = EntityEnum::PlayerTeam; break; } bool bHeal = pWeapon->GetWeaponID() == TF_WEAPON_CROSSBOW || pWeapon->GetWeaponID() == TF_WEAPON_LUNCHBOX; @@ -85,11 +85,11 @@ std::vector CAimbotProjectile::GetTargets(CTFPlayer* pLocal, CTFWeapon } { - auto eGroupType = EGroupType::GROUP_INVALID; + auto eGroupType = EntityEnum::Invalid; if (Vars::Aimbot::General::Target.Value & Vars::Aimbot::General::TargetEnum::Building) - eGroupType = EGroupType::BUILDINGS_ENEMIES; + eGroupType = EntityEnum::BuildingEnemy; if (Vars::Aimbot::Healing::AutoRepair.Value && pWeapon->GetWeaponID() == TF_WEAPON_SHOTGUN_BUILDING_RESCUE) - eGroupType = eGroupType != EGroupType::GROUP_INVALID ? EGroupType::BUILDINGS_ALL : EGroupType::BUILDINGS_TEAMMATES; + eGroupType = eGroupType != EntityEnum::Invalid ? EntityEnum::BuildingAll : EntityEnum::BuildingTeam; for (auto pEntity : H::Entities.GetGroup(eGroupType)) { if (F::AimbotGlobal.ShouldIgnore(pEntity, pLocal, pWeapon)) @@ -142,7 +142,7 @@ std::vector CAimbotProjectile::GetTargets(CTFPlayer* pLocal, CTFWeapon if (bShouldAim) { - for (auto pEntity : H::Entities.GetGroup(EGroupType::WORLD_PROJECTILES)) + for (auto pEntity : H::Entities.GetGroup(EntityEnum::WorldProjectile)) { if (F::AimbotGlobal.ShouldIgnore(pEntity, pLocal, pWeapon)) continue; @@ -161,7 +161,7 @@ std::vector CAimbotProjectile::GetTargets(CTFPlayer* pLocal, CTFWeapon if (Vars::Aimbot::General::Target.Value & Vars::Aimbot::General::TargetEnum::NPCs) // does not predict movement { - for (auto pEntity : H::Entities.GetGroup(EGroupType::WORLD_NPC)) + for (auto pEntity : H::Entities.GetGroup(EntityEnum::WorldNPC)) { if (F::AimbotGlobal.ShouldIgnore(pEntity, pLocal, pWeapon)) continue; diff --git a/Amalgam/src/Features/Aimbot/AutoAirblast/AutoAirblast.cpp b/Amalgam/src/Features/Aimbot/AutoAirblast/AutoAirblast.cpp index 4bc578fd..5f234eac 100644 --- a/Amalgam/src/Features/Aimbot/AutoAirblast/AutoAirblast.cpp +++ b/Amalgam/src/Features/Aimbot/AutoAirblast/AutoAirblast.cpp @@ -65,7 +65,7 @@ void CAutoAirblast::Run(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCmd* pCm const Vec3 vEyePos = pLocal->GetShootPos(); float flLatency = std::max(F::Backtrack.GetReal() - 0.03f, 0.f); - for (auto pProjectile : H::Entities.GetGroup(EGroupType::WORLD_PROJECTILES)) + for (auto pProjectile : H::Entities.GetGroup(EntityEnum::WorldProjectile)) { if (!ShouldTarget(pProjectile, pLocal)) continue; diff --git a/Amalgam/src/Features/Aimbot/AutoDetonate/AutoDetonate.cpp b/Amalgam/src/Features/Aimbot/AutoDetonate/AutoDetonate.cpp index 6e9a547b..c057994a 100644 --- a/Amalgam/src/Features/Aimbot/AutoDetonate/AutoDetonate.cpp +++ b/Amalgam/src/Features/Aimbot/AutoDetonate/AutoDetonate.cpp @@ -5,7 +5,7 @@ void CAutoDetonate::PredictPlayers(CTFPlayer* pLocal, float flLatency, bool bLoc if (!m_mRestore.empty()) RestorePlayers(); - for (auto pEntity : H::Entities.GetGroup(EGroupType::PLAYERS_ALL)) + for (auto pEntity : H::Entities.GetGroup(EntityEnum::PlayerAll)) { auto pPlayer = pEntity->As(); if (!bLocal @@ -26,9 +26,9 @@ void CAutoDetonate::RestorePlayers() m_mRestore.clear(); } -static inline bool GetRadius(EGroupType entityGroup, CBaseEntity* pProjectile, float& flRadius, CTFWeaponBase*& pWeapon) +static inline bool GetRadius(EntityEnum::EntityEnum iGroup, CBaseEntity* pProjectile, float& flRadius, CTFWeaponBase*& pWeapon) { - if (entityGroup == EGroupType::MISC_LOCAL_STICKIES) + if (iGroup == EntityEnum::LocalStickies) pWeapon = pProjectile->As()->m_hOriginalLauncher()->As(); else pWeapon = pProjectile->As()->m_hLauncher()->As(); @@ -39,7 +39,7 @@ static inline bool GetRadius(EGroupType entityGroup, CBaseEntity* pProjectile, f return false; } - if (entityGroup == EGroupType::MISC_LOCAL_STICKIES) + if (iGroup == EntityEnum::LocalStickies) { auto pPipebomb = pProjectile->As(); if (!pPipebomb->m_flCreationTime() || I::GlobalVars->curtime < pPipebomb->m_flCreationTime() + SDK::AttribHookValue(0.8f, "sticky_arm_time", pWeapon)) @@ -104,9 +104,9 @@ static inline bool CheckEntities(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUse return false; } -bool CAutoDetonate::CheckDetonation(CTFPlayer* pLocal, EGroupType entityGroup, float flRadiusScale, CUserCmd* pCmd) +bool CAutoDetonate::CheckDetonation(CTFPlayer* pLocal, EntityEnum::EntityEnum iGroup, float flRadiusScale, CUserCmd* pCmd) { - auto& vProjectiles = H::Entities.GetGroup(entityGroup); + auto& vProjectiles = H::Entities.GetGroup(iGroup); if (vProjectiles.empty()) return false; @@ -116,7 +116,7 @@ bool CAutoDetonate::CheckDetonation(CTFPlayer* pLocal, EGroupType entityGroup, f { float flRadius = flRadiusScale; CTFWeaponBase* pWeapon = nullptr; - if (!GetRadius(entityGroup, pProjectile, flRadius, pWeapon)) + if (!GetRadius(iGroup, pProjectile, flRadius, pWeapon)) continue; Vec3 vOrigin = SDK::PredictOrigin(pProjectile->m_vecOrigin(), pProjectile->GetAbsVelocity(), flLatency); @@ -147,12 +147,12 @@ static inline bool CheckLocal(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CBaseEn return true; } -bool CAutoDetonate::CheckSelf(CTFPlayer* pLocal, EGroupType entityGroup) +bool CAutoDetonate::CheckSelf(CTFPlayer* pLocal, EntityEnum::EntityEnum iGroup) { if (!(Vars::Aimbot::Projectile::AutoDetonate.Value & Vars::Aimbot::Projectile::AutoDetonateEnum::PreventSelfDamage) || !pLocal->IsAlive() || pLocal->IsAGhost()) return false; - auto& vProjectiles = H::Entities.GetGroup(entityGroup); + auto& vProjectiles = H::Entities.GetGroup(iGroup); if (vProjectiles.empty()) return false; @@ -162,7 +162,7 @@ bool CAutoDetonate::CheckSelf(CTFPlayer* pLocal, EGroupType entityGroup) { float flRadius = 1.f; CTFWeaponBase* pWeapon = nullptr; - if (!GetRadius(entityGroup, pProjectile, flRadius, pWeapon)) + if (!GetRadius(iGroup, pProjectile, flRadius, pWeapon)) continue; Vec3 vOrigin = SDK::PredictOrigin(pProjectile->m_vecOrigin(), pProjectile->GetAbsVelocity(), flLatency); @@ -184,11 +184,11 @@ void CAutoDetonate::Run(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCmd* pCm return; if ((Vars::Aimbot::Projectile::AutoDetonate.Value & Vars::Aimbot::Projectile::AutoDetonateEnum::Stickies - && CheckDetonation(pLocal, EGroupType::MISC_LOCAL_STICKIES, Vars::Aimbot::Projectile::AutodetRadius.Value / 100, pCmd) - && !CheckSelf(pLocal, EGroupType::MISC_LOCAL_STICKIES)) + && CheckDetonation(pLocal, EntityEnum::LocalStickies, Vars::Aimbot::Projectile::AutodetRadius.Value / 100, pCmd) + && !CheckSelf(pLocal, EntityEnum::LocalStickies)) || (Vars::Aimbot::Projectile::AutoDetonate.Value & Vars::Aimbot::Projectile::AutoDetonateEnum::Flares - && CheckDetonation(pLocal, EGroupType::MISC_LOCAL_FLARES, Vars::Aimbot::Projectile::AutodetRadius.Value / 100, pCmd)) - && !CheckSelf(pLocal, EGroupType::MISC_LOCAL_FLARES)) + && CheckDetonation(pLocal, EntityEnum::LocalFlares, Vars::Aimbot::Projectile::AutodetRadius.Value / 100, pCmd)) + && !CheckSelf(pLocal, EntityEnum::LocalFlares)) { pCmd->buttons |= IN_ATTACK2; } diff --git a/Amalgam/src/Features/Aimbot/AutoDetonate/AutoDetonate.h b/Amalgam/src/Features/Aimbot/AutoDetonate/AutoDetonate.h index 843428e7..a6a53a82 100644 --- a/Amalgam/src/Features/Aimbot/AutoDetonate/AutoDetonate.h +++ b/Amalgam/src/Features/Aimbot/AutoDetonate/AutoDetonate.h @@ -6,8 +6,8 @@ class CAutoDetonate { private: - bool CheckDetonation(CTFPlayer* pLocal, EGroupType entityGroup, float flRadiusScale, CUserCmd* pCmd); - bool CheckSelf(CTFPlayer* pLocal, EGroupType entityGroup); + bool CheckDetonation(CTFPlayer* pLocal, EntityEnum::EntityEnum iGroup, float flRadiusScale, CUserCmd* pCmd); + bool CheckSelf(CTFPlayer* pLocal, EntityEnum::EntityEnum iGroup); void PredictPlayers(CTFPlayer* pLocal, float flLatency, bool bLocal = false); void RestorePlayers(); diff --git a/Amalgam/src/Features/Aimbot/AutoHeal/AutoHeal.cpp b/Amalgam/src/Features/Aimbot/AutoHeal/AutoHeal.cpp index cdc6f573..3faba5b4 100644 --- a/Amalgam/src/Features/Aimbot/AutoHeal/AutoHeal.cpp +++ b/Amalgam/src/Features/Aimbot/AutoHeal/AutoHeal.cpp @@ -254,7 +254,7 @@ void CAutoHeal::GetDangers(CTFPlayer* pTarget, bool bVaccinator, float& flBullet Vec3 vTargetCenter = vTargetOrigin + pTarget->GetOffset() / 2; Vec3 vTargetEye = vTargetOrigin + pTarget->GetViewOffset(); - for (auto pEntity : H::Entities.GetGroup(EGroupType::PLAYERS_ENEMIES)) + for (auto pEntity : H::Entities.GetGroup(EntityEnum::PlayerEnemy)) { auto pPlayer = pEntity->As(); int iIndex = pPlayer->entindex(); @@ -297,7 +297,7 @@ void CAutoHeal::GetDangers(CTFPlayer* pTarget, bool bVaccinator, float& flBullet bool bPiss = SDK::AttribHookValue(0, "jarate_duration", pWeapon) > 0; auto GetSniperDot = [](CBaseEntity* pEntity) -> CSniperDot* { - for (auto pDot : H::Entities.GetGroup(EGroupType::MISC_DOTS)) + for (auto pDot : H::Entities.GetGroup(EntityEnum::SniperDots)) { if (pDot->m_hOwnerEntity().Get() == pEntity) return pDot->As(); @@ -399,7 +399,7 @@ void CAutoHeal::GetDangers(CTFPlayer* pTarget, bool bVaccinator, float& flBullet } } - for (auto pEntity : H::Entities.GetGroup(EGroupType::BUILDINGS_ENEMIES)) + for (auto pEntity : H::Entities.GetGroup(EntityEnum::BuildingEnemy)) { auto pSentry = pEntity->As(); if (!pSentry->IsBuilding()) @@ -437,7 +437,7 @@ void CAutoHeal::GetDangers(CTFPlayer* pTarget, bool bVaccinator, float& flBullet flBulletDanger += flDamageDanger * flDistanceDanger; } - for (auto pEntity : H::Entities.GetGroup(EGroupType::WORLD_PROJECTILES)) + for (auto pEntity : H::Entities.GetGroup(EntityEnum::WorldProjectile)) { CTFPlayer* pOwner = nullptr; CTFWeaponBase* pWeapon = nullptr; diff --git a/Amalgam/src/Features/Backtrack/Backtrack.cpp b/Amalgam/src/Features/Backtrack/Backtrack.cpp index 07b5e234..045810af 100644 --- a/Amalgam/src/Features/Backtrack/Backtrack.cpp +++ b/Amalgam/src/Features/Backtrack/Backtrack.cpp @@ -216,7 +216,7 @@ matrix3x4* CBacktrack::GetBones(CBaseEntity* pEntity) void CBacktrack::MakeRecords() { - for (auto& pEntity : H::Entities.GetGroup(EGroupType::PLAYERS_ALL)) + for (auto& pEntity : H::Entities.GetGroup(EntityEnum::PlayerAll)) { auto pPlayer = pEntity->As(); if (pPlayer->entindex() == I::EngineClient->GetLocalPlayer() || !pPlayer->IsAlive() || pPlayer->IsAGhost() @@ -279,7 +279,7 @@ void CBacktrack::MakeRecords() void CBacktrack::CleanRecords() { - for (auto& pEntity : H::Entities.GetGroup(EGroupType::PLAYERS_ALL)) + for (auto& pEntity : H::Entities.GetGroup(EntityEnum::PlayerAll)) { auto pPlayer = pEntity->As(); if (pPlayer->entindex() == I::EngineClient->GetLocalPlayer()) diff --git a/Amalgam/src/Features/CheaterDetection/CheaterDetection.cpp b/Amalgam/src/Features/CheaterDetection/CheaterDetection.cpp index 043ca327..8e26e918 100644 --- a/Amalgam/src/Features/CheaterDetection/CheaterDetection.cpp +++ b/Amalgam/src/Features/CheaterDetection/CheaterDetection.cpp @@ -104,7 +104,7 @@ void CCheaterDetection::Run() if (!pResource) return; - for (auto& pEntity : H::Entities.GetGroup(EGroupType::PLAYERS_ALL)) + for (auto& pEntity : H::Entities.GetGroup(EntityEnum::PlayerAll)) { auto pPlayer = pEntity->As(); int iIndex = pPlayer->entindex(); diff --git a/Amalgam/src/Features/EnginePrediction/EnginePrediction.cpp b/Amalgam/src/Features/EnginePrediction/EnginePrediction.cpp index c0806d58..7d621535 100644 --- a/Amalgam/src/Features/EnginePrediction/EnginePrediction.cpp +++ b/Amalgam/src/Features/EnginePrediction/EnginePrediction.cpp @@ -7,7 +7,7 @@ void CEnginePrediction::AdjustPlayers(CBaseEntity* pLocal) { m_mRestore.clear(); - for (auto pEntity : H::Entities.GetGroup(EGroupType::PLAYERS_ALL)) + for (auto pEntity : H::Entities.GetGroup(EntityEnum::PlayerAll)) { auto pPlayer = pEntity->As(); if (pPlayer == pLocal || !pPlayer->IsAlive() || pPlayer->IsAGhost()) diff --git a/Amalgam/src/Features/Misc/Misc.cpp b/Amalgam/src/Features/Misc/Misc.cpp index bc6fbf18..4ee596aa 100644 --- a/Amalgam/src/Features/Misc/Misc.cpp +++ b/Amalgam/src/Features/Misc/Misc.cpp @@ -430,7 +430,7 @@ int CMisc::AntiBackstab(CTFPlayer* pLocal, CUserCmd* pCmd, bool bSendPacket) return 0; std::vector> vTargets = {}; - for (auto pEntity : H::Entities.GetGroup(EGroupType::PLAYERS_ENEMIES)) + for (auto pEntity : H::Entities.GetGroup(EntityEnum::PlayerEnemy)) { auto pPlayer = pEntity->As(); if (!pPlayer->IsAlive() || pPlayer->IsAGhost() || pPlayer->InCond(TF_COND_STEALTHED)) diff --git a/Amalgam/src/Features/PacketManip/AntiAim/AntiAim.cpp b/Amalgam/src/Features/PacketManip/AntiAim/AntiAim.cpp index 0012b46a..8162f8a5 100644 --- a/Amalgam/src/Features/PacketManip/AntiAim/AntiAim.cpp +++ b/Amalgam/src/Features/PacketManip/AntiAim/AntiAim.cpp @@ -127,7 +127,7 @@ float CAntiAim::GetBaseYaw(CTFPlayer* pLocal, CUserCmd* pCmd, bool bFake) case Vars::AntiAim::YawModeEnum::Target: { float flSmallestAngleTo = 0.f; float flSmallestFovTo = 360.f; - for (auto pEntity : H::Entities.GetGroup(EGroupType::PLAYERS_ENEMIES)) + for (auto pEntity : H::Entities.GetGroup(EntityEnum::PlayerEnemy)) { auto pPlayer = pEntity->As(); if (!pPlayer->IsAlive() || pPlayer->IsAGhost() || F::PlayerUtils.IsIgnored(pPlayer->entindex())) diff --git a/Amalgam/src/Features/Resolver/Resolver.cpp b/Amalgam/src/Features/Resolver/Resolver.cpp index aca20078..ed2242f3 100644 --- a/Amalgam/src/Features/Resolver/Resolver.cpp +++ b/Amalgam/src/Features/Resolver/Resolver.cpp @@ -18,7 +18,7 @@ void CResolver::Reset() void CResolver::StoreSniperDots(CTFPlayerResource* pResource) { m_mSniperDots.clear(); - for (auto& pEntity : H::Entities.GetGroup(EGroupType::MISC_DOTS)) + for (auto& pEntity : H::Entities.GetGroup(EntityEnum::SniperDots)) { if (auto pOwner = pEntity->m_hOwnerEntity().Get()) { @@ -52,7 +52,7 @@ void CResolver::FrameStageNotify() return; StoreSniperDots(pResource); - for (auto& pEntity : H::Entities.GetGroup(EGroupType::PLAYERS_ALL)) + for (auto& pEntity : H::Entities.GetGroup(EntityEnum::PlayerAll)) { auto pPlayer = pEntity->As(); if (pPlayer->entindex() == I::EngineClient->GetLocalPlayer() || !pPlayer->IsAlive() || pPlayer->IsAGhost() @@ -133,7 +133,7 @@ void CResolver::CreateMove(CTFPlayer* pLocal) const Vec3 vLocalPos = F::Ticks.GetShootPos(); const Vec3 vLocalAngles = I::EngineClient->GetViewAngles(); - for (auto& pEntity : H::Entities.GetGroup(EGroupType::PLAYERS_ALL)) + for (auto& pEntity : H::Entities.GetGroup(EntityEnum::PlayerAll)) { if (pEntity->entindex() == I::EngineClient->GetLocalPlayer()) continue; diff --git a/Amalgam/src/Features/Simulation/MovementSimulation/MovementSimulation.cpp b/Amalgam/src/Features/Simulation/MovementSimulation/MovementSimulation.cpp index a5201189..6ce6b25c 100644 --- a/Amalgam/src/Features/Simulation/MovementSimulation/MovementSimulation.cpp +++ b/Amalgam/src/Features/Simulation/MovementSimulation/MovementSimulation.cpp @@ -36,7 +36,7 @@ void CMovementSimulation::Reset(MoveStorage& tStorage) void CMovementSimulation::Store() { - for (auto pEntity : H::Entities.GetGroup(EGroupType::PLAYERS_ALL)) + for (auto pEntity : H::Entities.GetGroup(EntityEnum::PlayerAll)) { auto pPlayer = pEntity->As(); auto& vRecords = m_mRecords[pPlayer->entindex()]; @@ -107,7 +107,7 @@ void CMovementSimulation::Store() } } - for (auto pEntity : H::Entities.GetGroup(EGroupType::PLAYERS_ALL)) + for (auto pEntity : H::Entities.GetGroup(EntityEnum::PlayerAll)) { auto pPlayer = pEntity->As(); auto& vSimTimes = m_mSimTimes[pPlayer->entindex()]; diff --git a/Amalgam/src/Features/Visuals/ESP/ESP.cpp b/Amalgam/src/Features/Visuals/ESP/ESP.cpp index 7545709e..756e7b8a 100644 --- a/Amalgam/src/Features/Visuals/ESP/ESP.cpp +++ b/Amalgam/src/Features/Visuals/ESP/ESP.cpp @@ -341,7 +341,7 @@ static inline void StorePlayer(CTFPlayer* pPlayer, CTFPlayer* pLocal, Group_t* p { auto GetSniperDot = [](CBaseEntity* pEntity) -> CSniperDot* { - for (auto pDot : H::Entities.GetGroup(EGroupType::MISC_DOTS)) + for (auto pDot : H::Entities.GetGroup(EntityEnum::SniperDots)) { if (pDot->m_hOwnerEntity().Get() == pEntity) return pDot->As(); diff --git a/Amalgam/src/Features/Visuals/Visuals.cpp b/Amalgam/src/Features/Visuals/Visuals.cpp index afb721e3..6239128f 100644 --- a/Amalgam/src/Features/Visuals/Visuals.cpp +++ b/Amalgam/src/Features/Visuals/Visuals.cpp @@ -218,7 +218,7 @@ void CVisuals::SplashRadius(CTFPlayer* pLocal) if (!Vars::Visuals::Simulation::SplashRadius.Value) return; - for (auto pEntity : H::Entities.GetGroup(EGroupType::WORLD_PROJECTILES)) + for (auto pEntity : H::Entities.GetGroup(EntityEnum::WorldProjectile)) { bool bShouldDraw = false; CTFPlayer* pOwner = nullptr; @@ -572,7 +572,7 @@ void CVisuals::DrawHitboxes(int iStore) s_vHitboxes.clear(); bool bLocalhost = SDK::IsLoopback(); - for (auto& pEntity : H::Entities.GetGroup(EGroupType::PLAYERS_ALL)) + for (auto& pEntity : H::Entities.GetGroup(EntityEnum::PlayerAll)) { auto pPlayer = pEntity->As(); if (pPlayer->entindex() == I::EngineClient->GetLocalPlayer() && !I::Input->CAM_IsThirdPerson() || !pPlayer->IsAlive()) @@ -822,14 +822,14 @@ void CVisuals::Store(CTFPlayer* pLocal) return; std::unordered_map mDots = {}; - for (auto pEntity : H::Entities.GetGroup(EGroupType::MISC_DOTS)) + for (auto pEntity : H::Entities.GetGroup(EntityEnum::SniperDots)) { if (auto pOwner = pEntity->m_hOwnerEntity().Get()) mDots[pOwner] = pEntity->m_vecOrigin(); } Group_t* pGroup = nullptr; - for (auto pEntity : H::Entities.GetGroup(EGroupType::PLAYERS_ALL)) + for (auto pEntity : H::Entities.GetGroup(EntityEnum::PlayerAll)) { auto pPlayer = pEntity->As(); if (pPlayer == pLocal diff --git a/Amalgam/src/Hooks/CBaseHudChatLine_InsertAndColorizeText.cpp b/Amalgam/src/Hooks/CBaseHudChatLine_InsertAndColorizeText.cpp index 00eea957..7145b385 100644 --- a/Amalgam/src/Hooks/CBaseHudChatLine_InsertAndColorizeText.cpp +++ b/Amalgam/src/Hooks/CBaseHudChatLine_InsertAndColorizeText.cpp @@ -60,7 +60,7 @@ MAKE_HOOK(CBaseHudChatLine_InsertAndColorizeText, S::CBaseHudChatLine_InsertAndC if (auto pResource = H::Entities.GetResource()) { std::vector> vReplace; - for (auto& pEntity : H::Entities.GetGroup(EGroupType::PLAYERS_ALL)) + for (auto& pEntity : H::Entities.GetGroup(EntityEnum::PlayerAll)) { int iIndex = pEntity->entindex(); int iType = 0; const char* sReplace = F::PlayerUtils.GetPlayerName(iIndex, nullptr, &iType); diff --git a/Amalgam/src/Hooks/CParticleProperty_Create.cpp b/Amalgam/src/Hooks/CParticleProperty_Create.cpp index e83bda04..1cacdf7e 100644 --- a/Amalgam/src/Hooks/CParticleProperty_Create.cpp +++ b/Amalgam/src/Hooks/CParticleProperty_Create.cpp @@ -143,7 +143,7 @@ MAKE_HOOK(CParticleProperty_Create_Point, S::CParticleProperty_Create_Point(), v return CALL_ORIGINAL(rcx, pszParticleName, iAttachType, iAttachmentPoint, vecOriginOffset); bool bValid = false; - for (auto pEntity : H::Entities.GetGroup(EGroupType::WORLD_PROJECTILES)) + for (auto pEntity : H::Entities.GetGroup(EntityEnum::WorldProjectile)) { auto pOwner = F::ProjSim.GetEntities(pEntity).second; if (bValid = pLocal == pOwner && rcx == &pEntity->m_Particles()) diff --git a/Amalgam/src/Hooks/CWeaponMedigun_PrimaryAttack.cpp b/Amalgam/src/Hooks/CWeaponMedigun_PrimaryAttack.cpp index 87a0036c..8c79c64a 100644 --- a/Amalgam/src/Hooks/CWeaponMedigun_PrimaryAttack.cpp +++ b/Amalgam/src/Hooks/CWeaponMedigun_PrimaryAttack.cpp @@ -24,7 +24,7 @@ MAKE_HOOK(CWeaponMedigun_PrimaryAttack, S::CWeaponMedigun_PrimaryAttack(), void, auto pCmd = pOwner->m_pCurrentCommand(); float flTargetTime = TICKS_TO_TIME(pCmd->tick_count - TIME_TO_TICKS(F::Backtrack.GetFakeInterp())); - for (auto pEntity : H::Entities.GetGroup(EGroupType::PLAYERS_TEAMMATES)) + for (auto pEntity : H::Entities.GetGroup(EntityEnum::PlayerTeam)) { auto pPlayer = pEntity->As(); if (pPlayer == pOwner || !pPlayer->IsAlive() || pPlayer->IsAGhost()) diff --git a/Amalgam/src/SDK/Helpers/Entities/Entities.cpp b/Amalgam/src/SDK/Helpers/Entities/Entities.cpp index 2260cf48..59cb59b6 100644 --- a/Amalgam/src/SDK/Helpers/Entities/Entities.cpp +++ b/Amalgam/src/SDK/Helpers/Entities/Entities.cpp @@ -39,24 +39,8 @@ void CEntities::Store() case ETFClassID::CObjectDispenser: case ETFClassID::CObjectTeleporter: m_mModels[n] = FNV1A::Hash32(I::ModelInfoClient->GetModelName(pEntity->GetModel())); - m_mGroups[EGroupType::BUILDINGS_ALL].push_back(pEntity); - m_mGroups[pEntity->m_iTeamNum() != m_pLocal->m_iTeamNum() ? EGroupType::BUILDINGS_ENEMIES : EGroupType::BUILDINGS_TEAMMATES].push_back(pEntity); - break; - case ETFClassID::CBaseAnimating: - { - m_mModels[n] = FNV1A::Hash32(I::ModelInfoClient->GetModelName(pEntity->GetModel())); - if (IsHealth(GetModel(n))) - m_mGroups[EGroupType::PICKUPS_HEALTH].push_back(pEntity); - else if (IsAmmo(GetModel(n))) - m_mGroups[EGroupType::PICKUPS_AMMO].push_back(pEntity); - else if (IsPowerup(GetModel(n))) - m_mGroups[EGroupType::PICKUPS_POWERUP].push_back(pEntity); - else if (IsSpellbook(GetModel(n))) - m_mGroups[EGroupType::PICKUPS_SPELLBOOK].push_back(pEntity); - break; - } - case ETFClassID::CTFAmmoPack: - m_mGroups[EGroupType::PICKUPS_AMMO].push_back(pEntity); + m_mGroups[EntityEnum::BuildingAll].push_back(pEntity); + m_mGroups[pEntity->m_iTeamNum() != m_pLocal->m_iTeamNum() ? EntityEnum::BuildingEnemy : EntityEnum::BuildingTeam].push_back(pEntity); break; case ETFClassID::CBaseProjectile: case ETFClassID::CBaseGrenade: @@ -104,48 +88,64 @@ void CEntities::Store() || (nClassID == ETFClassID::CTFProjectile_Arrow || nClassID == ETFClassID::CTFProjectile_GrapplingHook) && !pEntity->m_MoveType()) break; - m_mGroups[EGroupType::WORLD_PROJECTILES].push_back(pEntity); + m_mGroups[EntityEnum::WorldProjectile].push_back(pEntity); if (nClassID == ETFClassID::CTFGrenadePipebombProjectile) { auto pPipebomb = pEntity->As(); if (pPipebomb->m_hThrower().Get() == pLocal && pPipebomb->m_iType() == TF_GL_MODE_REMOTE_DETONATE /*pPipebomb->HasStickyEffects()*/) - m_mGroups[EGroupType::MISC_LOCAL_STICKIES].push_back(pEntity); + m_mGroups[EntityEnum::LocalStickies].push_back(pEntity); } if (nClassID == ETFClassID::CTFProjectile_Flare) { auto pLauncher = pEntity->As()->m_hLauncher()->As(); if (pEntity->m_hOwnerEntity().Get() == m_pLocal && pLauncher && pLauncher->As()->GetFlareGunType() == FLAREGUN_DETONATE) - m_mGroups[EGroupType::MISC_LOCAL_FLARES].push_back(pEntity); + m_mGroups[EntityEnum::LocalFlares].push_back(pEntity); } break; } - case ETFClassID::CCaptureFlag: - m_mGroups[EGroupType::WORLD_OBJECTIVE].push_back(pEntity); - break; case ETFClassID::CTFBaseBoss: case ETFClassID::CTFTankBoss: case ETFClassID::CMerasmus: case ETFClassID::CEyeballBoss: case ETFClassID::CHeadlessHatman: case ETFClassID::CZombie: - m_mGroups[EGroupType::WORLD_NPC].push_back(pEntity); + m_mGroups[EntityEnum::WorldNPC].push_back(pEntity); break; case ETFClassID::CTFPumpkinBomb: case ETFClassID::CTFGenericBomb: - m_mGroups[EGroupType::WORLD_BOMBS].push_back(pEntity); + m_mGroups[EntityEnum::WorldBomb].push_back(pEntity); break; - case ETFClassID::CCurrencyPack: - m_mGroups[EGroupType::PICKUPS_MONEY].push_back(pEntity); - break; - case ETFClassID::CHalloweenGiftPickup: - if (pEntity->As()->m_hTargetPlayer().Get() == m_pLocal) - m_mGroups[EGroupType::WORLD_GARGOYLE].push_back(pEntity); + case ETFClassID::CBaseAnimating: + { + m_mModels[n] = FNV1A::Hash32(I::ModelInfoClient->GetModelName(pEntity->GetModel())); + //if (IsHealth(GetModel(n))) + // m_mGroups[EntityEnum::PickupHealth].push_back(pEntity); + //else if (IsAmmo(GetModel(n))) + // m_mGroups[EntityEnum::PickupAmmo].push_back(pEntity); + //else if (IsPowerup(GetModel(n))) + // m_mGroups[EntityEnum::PickupPowerup].push_back(pEntity); + //else if (IsSpellbook(GetModel(n))) + // m_mGroups[EntityEnum::PickupSpellbook].push_back(pEntity); break; + } + //case ETFClassID::CTFAmmoPack: + // m_mGroups[EntityEnum::PickupAmmo].push_back(pEntity); + // break; + //case ETFClassID::CCurrencyPack: + // m_mGroups[EntityEnum::PickupMoney].push_back(pEntity); + // break; + //case ETFClassID::CHalloweenGiftPickup: + // if (pEntity->As()->m_hTargetPlayer().Get() == m_pLocal) + // m_mGroups[EntityEnum::PickupGargoyle].push_back(pEntity); + // break; + //case ETFClassID::CCaptureFlag: + // m_mGroups[EntityEnum::WorldObjective].push_back(pEntity); + // break; case ETFClassID::CSniperDot: - m_mGroups[EGroupType::MISC_DOTS].push_back(pEntity); + m_mGroups[EntityEnum::SniperDots].push_back(pEntity); break; } } @@ -220,8 +220,8 @@ void CEntities::Store() continue; m_mModels[n] = FNV1A::Hash32(I::ModelInfoClient->GetModelName(pPlayer->GetModel())); - m_mGroups[EGroupType::PLAYERS_ALL].push_back(pPlayer); - m_mGroups[pPlayer->m_iTeamNum() != m_pLocal->m_iTeamNum() ? EGroupType::PLAYERS_ENEMIES : EGroupType::PLAYERS_TEAMMATES].push_back(pPlayer); + m_mGroups[EntityEnum::PlayerAll].push_back(pPlayer); + m_mGroups[pPlayer->m_iTeamNum() != m_pLocal->m_iTeamNum() ? EntityEnum::PlayerEnemy : EntityEnum::PlayerTeam].push_back(pPlayer); if (n != I::EngineClient->GetLocalPlayer()) { @@ -250,7 +250,7 @@ void CEntities::Store() } } F::Resolver.FrameStageNotify(); - for (auto pEntity : H::Entities.GetGroup(EGroupType::PLAYERS_ALL)) + for (auto pEntity : H::Entities.GetGroup(EntityEnum::PlayerAll)) { auto pPlayer = pEntity->As(); if (!pPlayer->IsAlive() || pPlayer->entindex() == I::EngineClient->GetLocalPlayer() && !I::EngineClient->IsPlayingDemo()) // local player managed in CreateMove @@ -475,7 +475,7 @@ CTFPlayerResource* CEntities::GetResource() return m_pPlayerResource; } -const std::vector& CEntities::GetGroup(const EGroupType& Group) { return m_mGroups[Group]; } +const std::vector& CEntities::GetGroup(const EntityEnum::EntityEnum iGroup) { return m_mGroups[iGroup]; } float CEntities::GetDeltaTime(int iIndex) { return m_mDeltaTimes.contains(iIndex) ? m_mDeltaTimes[iIndex] : TICK_INTERVAL; } float CEntities::GetLagTime(int iIndex) { return m_mLagTimes.contains(iIndex) ? m_mLagTimes[iIndex] : TICK_INTERVAL; } diff --git a/Amalgam/src/SDK/Helpers/Entities/Entities.h b/Amalgam/src/SDK/Helpers/Entities/Entities.h index 120cf6e2..6174aff0 100644 --- a/Amalgam/src/SDK/Helpers/Entities/Entities.h +++ b/Amalgam/src/SDK/Helpers/Entities/Entities.h @@ -1,17 +1,16 @@ #pragma once #include "../../../Utils/Macros/Macros.h" #include "../../Definitions/Classes.h" +#include "../../Vars.h" #include -enum struct EGroupType -{ - GROUP_INVALID = -1, - PLAYERS_ALL, PLAYERS_ENEMIES, PLAYERS_TEAMMATES, - BUILDINGS_ALL, BUILDINGS_ENEMIES, BUILDINGS_TEAMMATES, - PICKUPS_HEALTH, PICKUPS_AMMO, PICKUPS_MONEY, PICKUPS_POWERUP, PICKUPS_SPELLBOOK, - WORLD_PROJECTILES, WORLD_OBJECTIVE, WORLD_NPC, WORLD_BOMBS, WORLD_GARGOYLE, - MISC_LOCAL_STICKIES, MISC_LOCAL_FLARES, MISC_DOTS -}; +Enum(Entity, Invalid = -1, + PlayerAll, PlayerEnemy, PlayerTeam, + BuildingAll, BuildingEnemy, BuildingTeam, + PickupHealth, PickupAmmo, PickupMoney, PickupPowerup, PickupSpellbook, PickupGargoyle, + WorldProjectile, WorldObjective, WorldNPC, WorldBomb, + LocalStickies, LocalFlares, SniperDots +) struct DormantData { @@ -34,7 +33,7 @@ private: CTFWeaponBase* m_pLocalWeapon = nullptr; CTFPlayerResource* m_pPlayerResource = nullptr; - std::unordered_map> m_mGroups = {}; + std::unordered_map> m_mGroups = {}; std::unordered_map m_mDeltaTimes = {}, m_mLagTimes = {}; std::unordered_map m_mChokes = {}, m_mSetTicks = {}; @@ -71,7 +70,7 @@ public: CTFWeaponBase* GetWeapon(); CTFPlayerResource* GetResource(); - const std::vector& GetGroup(const EGroupType& Group); + const std::vector& GetGroup(const EntityEnum::EntityEnum iGroup); float GetDeltaTime(int iIndex); float GetLagTime(int iIndex); diff --git a/Amalgam/src/Utils/Macros/Macros.h b/Amalgam/src/Utils/Macros/Macros.h index 057e8c51..04cbccb3 100644 --- a/Amalgam/src/Utils/Macros/Macros.h +++ b/Amalgam/src/Utils/Macros/Macros.h @@ -1,14 +1,14 @@ #pragma once +#define VA_LIST(...) __VA_ARGS__ + +#define STRINGIFY(x) STRINGIFY2(x) +#define STRINGIFY2(x) #x +#define __LINESTRING__ STRINGIFY(__LINE__) + #define ADD_FEATURE_CUSTOM(type, name, scope) namespace scope { inline type name; } #define ADD_FEATURE(type, name) ADD_FEATURE_CUSTOM(type, name, F) -#define VA_LIST(...) __VA_ARGS__ -#define FUNCSIG __FUNCSIG__ -#define STRINGIZE(x) STRINGIZE2(x) -#define STRINGIZE2(x) #x -#define LINE_STRING STRINGIZE(__LINE__) - -#define Assert(cond) if (!cond) { MessageBox(0, #cond "\n\n" FUNCSIG " Line " LINE_STRING, "Error", MB_OK | MB_ICONERROR); } -#define AssertFatal(cond) if (!cond) { MessageBox(0, #cond "\n\n" FUNCSIG " Line " LINE_STRING, "Error", MB_OK | MB_ICONERROR); exit(EXIT_FAILURE); } +#define Assert(cond) if (!cond) { MessageBox(0, #cond "\n\n" __FUNCSIG__ " Line " __LINESTRING__, "Error", MB_OK | MB_ICONERROR); } +#define AssertFatal(cond) if (!cond) { MessageBox(0, #cond "\n\n" __FUNCSIG__ " Line " __LINESTRING__, "Error", MB_OK | MB_ICONERROR); exit(EXIT_FAILURE); } #define AssertCustom(cond, message) if (!cond) { MessageBox(0, message, "Error", MB_OK | MB_ICONERROR); } \ No newline at end of file