Fix building aimbot issues
This commit is contained in:
parent
f62655c58c
commit
776e6391f2
@ -1127,7 +1127,7 @@ Vector PredictEntity(CachedEntity *entity, bool vischeck)
|
||||
// Buildings
|
||||
else if (entity->m_Type() == ENTITY_BUILDING)
|
||||
{
|
||||
if (cur_proj_grav || cur_proj_grav)
|
||||
if (projectileAimbotRequired)
|
||||
{
|
||||
std::pair<Vector, Vector> tmp_result;
|
||||
tmp_result = BuildingPrediction(entity, GetBuildingPosition(entity), cur_proj_speed, cur_proj_grav, cur_proj_start_vel);
|
||||
|
@ -402,7 +402,7 @@ std::pair<Vector, Vector> BuildingPrediction(CachedEntity *building, Vector vec,
|
||||
return { Vector(), Vector() };
|
||||
|
||||
trace::filter_no_player.SetSelf(RAW_ENT(building));
|
||||
float dtg = DistanceToGround(vec, RAW_ENT(building)->GetCollideable()->OBBMins(), RAW_ENT(building)->GetCollideable()->OBBMaxs());
|
||||
|
||||
// TODO ProjAim
|
||||
float medianTime = g_pLocalPlayer->v_Eye.DistTo(result) / speed;
|
||||
float range = 1.5f;
|
||||
@ -416,11 +416,6 @@ std::pair<Vector, Vector> BuildingPrediction(CachedEntity *building, Vector vec,
|
||||
for (int steps = 0; steps < maxsteps; steps++, currenttime += ((float) (2 * range) / (float) maxsteps))
|
||||
{
|
||||
Vector curpos = result;
|
||||
if (dtg > 0.0f)
|
||||
{
|
||||
if (curpos.z < result.z - dtg)
|
||||
curpos.z = result.z - dtg;
|
||||
}
|
||||
float rockettime = g_pLocalPlayer->v_Eye.DistTo(curpos) / speed;
|
||||
// Compensate for ping
|
||||
rockettime += g_IEngine->GetNetChannelInfo()->GetLatency(FLOW_OUTGOING) + cl_interp->GetFloat();
|
||||
|
Reference in New Issue
Block a user