mirror of
https://github.com/rei-2/Amalgam.git
synced 2026-10-11 01:38:15 +08:00
more consistent interpolated hitboxes
This commit is contained in:
1 parent
aaf14f3b36
commit
76149e1b77
4 files changed
+30
-18
No files matched your search
@@ -3,10 +3,11 @@
|
||||
#include "../Aimbot.h"
|
||||
#include "../../Players/PlayerUtils.h"
|
||||
#include "../../Ticks/Ticks.h"
|
||||
#include "../../EnginePrediction/EnginePrediction.h"
|
||||
|
||||
std::vector<Target_t> CAimbotGlobal::ManageTargets(std::vector<Target_t>(*GetTargets)(CTFPlayer* pLocal, CTFWeaponBase* pWeapon), CTFPlayer* pLocal, CTFWeaponBase* pWeapon,
|
||||
int iMethod, int iMaxTargets)
|
||||
{
|
||||
{
|
||||
auto vTargets = GetTargets(pLocal, pWeapon);
|
||||
SortTargetsPre(vTargets, iMethod);
|
||||
vTargets.resize(std::min(size_t(iMaxTargets), vTargets.size()));
|
||||
@@ -16,8 +17,8 @@ std::vector<Target_t> CAimbotGlobal::ManageTargets(std::vector<Target_t>(*GetTar
|
||||
|
||||
void CAimbotGlobal::SortTargetsPre(std::vector<Target_t>& vTargets, int iMethod)
|
||||
{
|
||||
switch (iMethod)
|
||||
{
|
||||
switch (iMethod)
|
||||
{
|
||||
case Vars::Aimbot::General::TargetSelectionEnum::FOV:
|
||||
return std::sort(vTargets.begin(), vTargets.end(), [&](const Target_t& a, const Target_t& b) -> bool
|
||||
{
|
||||
@@ -29,7 +30,7 @@ void CAimbotGlobal::SortTargetsPre(std::vector<Target_t>& vTargets, int iMethod)
|
||||
{
|
||||
return a.m_flDistTo < b.m_flDistTo;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CAimbotGlobal::SortTargetsPost(std::vector<Target_t>& vTargets, int iMethod)
|
||||
@@ -40,11 +41,9 @@ void CAimbotGlobal::SortTargetsPost(std::vector<Target_t>& vTargets, int iMethod
|
||||
return std::sort(vTargets.begin(), vTargets.end(), [&](const Target_t& a, const Target_t& b) -> bool
|
||||
{
|
||||
return a.m_flFOVTo < b.m_flFOVTo;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void CAimbotGlobal::SortPriority(std::vector<Target_t>& vTargets)
|
||||
{ // Sort by priority
|
||||
std::sort(vTargets.begin(), vTargets.end(), [&](const Target_t& a, const Target_t& b) -> bool
|
||||
{
|
||||
return a.m_nPriority > b.m_nPriority;
|
||||
@@ -54,8 +53,24 @@ void CAimbotGlobal::SortPriority(std::vector<Target_t>& vTargets)
|
||||
// this won't prevent shooting bones outside of fov
|
||||
bool CAimbotGlobal::PlayerBoneInFOV(CTFPlayer* pTarget, Vec3 vLocalPos, Vec3 vLocalAngles, float& flFOVTo, Vec3& vPos, Vec3& vAngleTo, int iHitboxes)
|
||||
{
|
||||
matrix3x4 aBones[MAXSTUDIOBONES];
|
||||
if (!pTarget->SetupBones(aBones, MAXSTUDIOBONES, BONE_USED_BY_ANYTHING, I::GlobalVars->curtime))
|
||||
matrix3x4* aBones = F::Backtrack.GetBones(pTarget);
|
||||
if (!Vars::Visuals::Removals::Interpolation.Value)
|
||||
{
|
||||
std::vector<TickRecord*> vRecords = {};
|
||||
if (F::Backtrack.GetRecords(pTarget, vRecords) && !vRecords.empty())
|
||||
{
|
||||
float flLerp = Vars::Visuals::Removals::Lerp.Value ? 0.f : G::Lerp;
|
||||
for (auto pRecord : vRecords)
|
||||
{
|
||||
if (F::EnginePrediction.m_flOldCurrentTime - pRecord->m_flSimTime > flLerp)
|
||||
{
|
||||
aBones = pRecord->m_aBones;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!aBones)
|
||||
return false;
|
||||
|
||||
float flMinFOV = 180.f;
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include "../../Simulation/ProjectileSimulation/ProjectileSimulation.h"
|
||||
#include "../../EnginePrediction/EnginePrediction.h"
|
||||
#include "../../Ticks/Ticks.h"
|
||||
#include "../../Visuals/Visuals.h"
|
||||
#include "../AutoAirblast/AutoAirblast.h"
|
||||
|
||||
//#define SPLASH_DEBUG1 // normal splash visualization
|
||||
|
||||
@@ -20,13 +20,7 @@ private:
|
||||
void Simulate(CTFPlayer* pLocal, CUserCmd* pCmd);
|
||||
|
||||
CMoveData m_MoveData = {};
|
||||
|
||||
int m_nOldTickCount = 0;
|
||||
float m_flOldCurrentTime = 0.f;
|
||||
float m_flOldFrameTime = 0.f;
|
||||
|
||||
DatamapRestore_t m_tLocal = {};
|
||||
|
||||
std::unordered_map<CTFPlayer*, RestoreInfo_t> m_mRestore = {};
|
||||
|
||||
public:
|
||||
@@ -40,6 +34,10 @@ public:
|
||||
|
||||
bool m_bInPrediction = false;
|
||||
|
||||
int m_nOldTickCount = 0;
|
||||
float m_flOldCurrentTime = 0.f;
|
||||
float m_flOldFrameTime = 0.f;
|
||||
|
||||
// localplayer use in net_update_end
|
||||
Vec3 m_vOrigin = {};
|
||||
Vec3 m_vVelocity = {};
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
#define DEBUG_TEXT
|
||||
//#define DEBUG_TEXT
|
||||
|
||||
struct Projectile_t
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user