mirror of
https://github.com/rei-2/Amalgam
synced 2026-10-10 04:43:09 +08:00
update entitycache enum
comment out currently unused groups in entitycache
This commit is contained in:
+14
-4
@@ -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<int>(0.5f + static_cast<float>(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)
|
||||
#define DEFAULT_BIND -1
|
||||
@@ -15,16 +15,16 @@ std::vector<Target_t> 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<Target_t> 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<Target_t> 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<Target_t> 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<Target_t> 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);
|
||||
|
||||
@@ -15,10 +15,10 @@ std::vector<Target_t> 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<Target_t> 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<Target_t> 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<Target_t> vTargets;
|
||||
for (auto pEntity : H::Entities.GetGroup(EGroupType::BUILDINGS_ENEMIES))
|
||||
for (auto pEntity : H::Entities.GetGroup(EntityEnum::BuildingEnemy))
|
||||
{
|
||||
auto pBuilding = pEntity->As<CBaseObject>();
|
||||
if (pBuilding->m_bHasSapper() || !pBuilding->IsInValidTeam())
|
||||
|
||||
@@ -28,18 +28,18 @@ std::vector<Target_t> 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<Target_t> 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<Target_t> 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<Target_t> 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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<CTFPlayer>();
|
||||
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<CTFGrenadePipebombProjectile>()->m_hOriginalLauncher()->As<CTFWeaponBase>();
|
||||
else
|
||||
pWeapon = pProjectile->As<CTFProjectile_Flare>()->m_hLauncher()->As<CTFWeaponBase>();
|
||||
@@ -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<CTFGrenadePipebombProjectile>();
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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<CTFPlayer>();
|
||||
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<CSniperDot>();
|
||||
@@ -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<CObjectSentrygun>();
|
||||
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;
|
||||
|
||||
@@ -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<CTFPlayer>();
|
||||
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<CTFPlayer>();
|
||||
if (pPlayer->entindex() == I::EngineClient->GetLocalPlayer())
|
||||
|
||||
@@ -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<CTFPlayer>();
|
||||
int iIndex = pPlayer->entindex();
|
||||
|
||||
@@ -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<CTFPlayer>();
|
||||
if (pPlayer == pLocal || !pPlayer->IsAlive() || pPlayer->IsAGhost())
|
||||
|
||||
@@ -430,7 +430,7 @@ int CMisc::AntiBackstab(CTFPlayer* pLocal, CUserCmd* pCmd, bool bSendPacket)
|
||||
return 0;
|
||||
|
||||
std::vector<std::pair<Vec3, CBaseEntity*>> vTargets = {};
|
||||
for (auto pEntity : H::Entities.GetGroup(EGroupType::PLAYERS_ENEMIES))
|
||||
for (auto pEntity : H::Entities.GetGroup(EntityEnum::PlayerEnemy))
|
||||
{
|
||||
auto pPlayer = pEntity->As<CTFPlayer>();
|
||||
if (!pPlayer->IsAlive() || pPlayer->IsAGhost() || pPlayer->InCond(TF_COND_STEALTHED))
|
||||
|
||||
@@ -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<CTFPlayer>();
|
||||
if (!pPlayer->IsAlive() || pPlayer->IsAGhost() || F::PlayerUtils.IsIgnored(pPlayer->entindex()))
|
||||
|
||||
@@ -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<CTFPlayer>();
|
||||
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;
|
||||
|
||||
@@ -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<CTFPlayer>();
|
||||
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<CTFPlayer>();
|
||||
auto& vSimTimes = m_mSimTimes[pPlayer->entindex()];
|
||||
|
||||
@@ -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<CSniperDot>();
|
||||
|
||||
@@ -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<CTFPlayer>();
|
||||
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<IClientEntity*, Vec3> 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<CTFPlayer>();
|
||||
if (pPlayer == pLocal
|
||||
|
||||
@@ -60,7 +60,7 @@ MAKE_HOOK(CBaseHudChatLine_InsertAndColorizeText, S::CBaseHudChatLine_InsertAndC
|
||||
if (auto pResource = H::Entities.GetResource())
|
||||
{
|
||||
std::vector<std::pair<std::string, std::string>> 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);
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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<CTFPlayer>();
|
||||
if (pPlayer == pOwner || !pPlayer->IsAlive() || pPlayer->IsAGhost())
|
||||
|
||||
@@ -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<CTFGrenadePipebombProjectile>();
|
||||
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<CTFProjectile_Flare>()->m_hLauncher()->As<CTFWeaponBase>();
|
||||
if (pEntity->m_hOwnerEntity().Get() == m_pLocal && pLauncher && pLauncher->As<CTFFlareGun>()->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<CHalloweenGiftPickup>()->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<CHalloweenGiftPickup>()->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<CTFPlayer>();
|
||||
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<CBaseEntity*>& CEntities::GetGroup(const EGroupType& Group) { return m_mGroups[Group]; }
|
||||
const std::vector<CBaseEntity*>& 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; }
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
#pragma once
|
||||
#include "../../../Utils/Macros/Macros.h"
|
||||
#include "../../Definitions/Classes.h"
|
||||
#include "../../Vars.h"
|
||||
#include <unordered_map>
|
||||
|
||||
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<EGroupType, std::vector<CBaseEntity*>> m_mGroups = {};
|
||||
std::unordered_map<EntityEnum::EntityEnum, std::vector<CBaseEntity*>> m_mGroups = {};
|
||||
|
||||
std::unordered_map<int, float> m_mDeltaTimes = {}, m_mLagTimes = {};
|
||||
std::unordered_map<int, int> m_mChokes = {}, m_mSetTicks = {};
|
||||
@@ -71,7 +70,7 @@ public:
|
||||
CTFWeaponBase* GetWeapon();
|
||||
CTFPlayerResource* GetResource();
|
||||
|
||||
const std::vector<CBaseEntity*>& GetGroup(const EGroupType& Group);
|
||||
const std::vector<CBaseEntity*>& GetGroup(const EntityEnum::EntityEnum iGroup);
|
||||
|
||||
float GetDeltaTime(int iIndex);
|
||||
float GetLagTime(int iIndex);
|
||||
|
||||
@@ -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); }
|
||||
Reference in New Issue
Block a user