Fix building prediction

This commit is contained in:
LightCat 2018-10-07 16:09:27 +02:00
parent 8940256c87
commit 22d5c3971d
2 changed files with 5 additions and 10 deletions

View File

@ -928,8 +928,11 @@ const Vector &PredictEntity(CachedEntity *entity)
}
else if (entity->m_Type() == ENTITY_BUILDING)
{
result = BuildingPrediction(entity, GetBuildingPosition(entity),
cur_proj_speed, cur_proj_grav);
if (cur_proj_grav || cur_proj_grav)
result = BuildingPrediction(entity, GetBuildingPosition(entity),
cur_proj_speed, cur_proj_grav);
else
result = GetBuildingPosition(entity);
// Other
}
else

View File

@ -267,8 +267,6 @@ Vector BuildingPrediction(CachedEntity *building, Vector vec, float speed,
// result = SimpleLatencyPrediction(ent, hb);
//
//}
float latency = g_IEngine->GetNetChannelInfo()->GetLatency(FLOW_OUTGOING) +
g_IEngine->GetNetChannelInfo()->GetLatency(FLOW_INCOMING);
if (speed == 0.0f)
return Vector();
@ -288,14 +286,8 @@ Vector BuildingPrediction(CachedEntity *building, Vector vec, float speed,
steps++, currenttime += ((float) (2 * range) / (float) maxsteps))
{
Vector curpos = result;
curpos += 0 * currenttime;
if (debug_pp_extrapolate)
{
curpos += 0 * currenttime * latency;
}
if (dtg > 0.0f)
{
curpos.z -= currenttime * currenttime * 400.0f * 0;
if (curpos.z < result.z - dtg)
curpos.z = result.z - dtg;
}