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