Fix inverted delta math and reorder Auto hitbox for projectile weapons
This commit is contained in:
parent
f6c581ece6
commit
d1a6f4e8df
@ -1437,7 +1437,7 @@ int BestHitbox(CachedEntity *target)
|
|||||||
if (target->hitboxes.VisibilityCheck(preferred))
|
if (target->hitboxes.VisibilityCheck(preferred))
|
||||||
return preferred;
|
return preferred;
|
||||||
// Else attempt to find any hitbox at all
|
// Else attempt to find any hitbox at all
|
||||||
for (int i = projectile_mode ? 1 : 0; i < target->hitboxes.GetNumHitboxes() && i < 6; i++)
|
for (int i = 6; i > projectile_mode ? 1 : 0 && i < 6; i--)
|
||||||
if (target->hitboxes.VisibilityCheck(i))
|
if (target->hitboxes.VisibilityCheck(i))
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
@ -546,7 +546,7 @@ std::pair<Vector, Vector> ProjectilePrediction_Engine(CachedEntity *ent, int hb,
|
|||||||
float rockettime = g_pLocalPlayer->v_Eye.DistTo(current) / speed;
|
float rockettime = g_pLocalPlayer->v_Eye.DistTo(current) / speed;
|
||||||
// Compensate for ping
|
// Compensate for ping
|
||||||
rockettime += g_IEngine->GetNetChannelInfo()->GetLatency(FLOW_OUTGOING) + cl_interp->GetFloat();
|
rockettime += g_IEngine->GetNetChannelInfo()->GetLatency(FLOW_OUTGOING) + cl_interp->GetFloat();
|
||||||
float timedelta = fabs(rockettime - currenttime);
|
float timedelta = fabs(currenttime - rockettime);
|
||||||
if (timedelta < mindelta)
|
if (timedelta < mindelta)
|
||||||
{
|
{
|
||||||
besttime = currenttime;
|
besttime = currenttime;
|
||||||
@ -650,7 +650,7 @@ std::pair<Vector, Vector> ProjectilePrediction(CachedEntity *ent, int hb, float
|
|||||||
float rockettime = g_pLocalPlayer->v_Eye.DistTo(current) / speed;
|
float rockettime = g_pLocalPlayer->v_Eye.DistTo(current) / speed;
|
||||||
// Compensate for ping
|
// Compensate for ping
|
||||||
rockettime += g_IEngine->GetNetChannelInfo()->GetLatency(FLOW_OUTGOING) + cl_interp->GetFloat();
|
rockettime += g_IEngine->GetNetChannelInfo()->GetLatency(FLOW_OUTGOING) + cl_interp->GetFloat();
|
||||||
if (fabs(rockettime - currenttime) < mindelta)
|
if (fabs(currenttime - rockettime) < mindelta)
|
||||||
{
|
{
|
||||||
besttime = currenttime;
|
besttime = currenttime;
|
||||||
bestpos = current;
|
bestpos = current;
|
||||||
|
Reference in New Issue
Block a user