From e1bf805d3fa1b26e915cbf8302a1848d678f7cb8 Mon Sep 17 00:00:00 2001 From: havoc Date: Thu, 3 Jul 2003 00:45:48 +0000 Subject: [PATCH] got rid of sv_predict because it caused too many problems with mods trying to have multiple entities attached to eachother git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3147 d7cf8633-e32d-0410-b094-e92efae38249 --- server.h | 3 --- sv_main.c | 25 ++----------------------- sv_user.c | 5 ----- 3 files changed, 2 insertions(+), 31 deletions(-) diff --git a/server.h b/server.h index 8eb1153d..aa2493fa 100644 --- a/server.h +++ b/server.h @@ -133,8 +133,6 @@ typedef struct client_s int num_pings; // LordHavoc: can be used for prediction or whatever... float ping; - // LordHavoc: specifically used for prediction, accounts for sys_ticrate too - float latency; // spawn parms are carried from level to level float spawn_parms[NUM_SPAWN_PARMS]; @@ -245,7 +243,6 @@ extern cvar_t sv_maxspeed; extern cvar_t sv_accelerate; extern cvar_t sv_idealpitchscale; extern cvar_t sv_aim; -extern cvar_t sv_predict; extern cvar_t sv_stepheight; extern cvar_t sv_jumpstep; diff --git a/sv_main.c b/sv_main.c index a80badc1..da2675f1 100644 --- a/sv_main.c +++ b/sv_main.c @@ -59,7 +59,6 @@ void SV_Init (void) Cvar_RegisterVariable (&sv_idealpitchscale); Cvar_RegisterVariable (&sv_aim); Cvar_RegisterVariable (&sv_nostep); - Cvar_RegisterVariable (&sv_predict); Cvar_RegisterVariable (&sv_deltacompress); Cvar_RegisterVariable (&sv_cullentities_pvs); Cvar_RegisterVariable (&sv_cullentities_portal); @@ -555,17 +554,7 @@ void SV_WriteEntitiesToClient (client_t *client, edict_t *clent, sizebuf_t *msg) } VectorCopy(ent->v->angles, angles); - if (DotProduct(ent->v->velocity, ent->v->velocity) >= 1.0f) - { - VectorMA(ent->v->origin, host_client->latency, ent->v->velocity, origin); - // LordHavoc: trace predicted movement to avoid putting things in walls - trace = SV_Move (ent->v->origin, ent->v->mins, ent->v->maxs, origin, MOVE_NORMAL, ent); - VectorCopy(trace.endpos, origin); - } - else - { - VectorCopy(ent->v->origin, origin); - } + VectorCopy(ent->v->origin, origin); // ent has survived every check so far, check if it is visible if (ent != clent && ((bits & U_VIEWMODEL) == 0)) @@ -937,17 +926,7 @@ void SV_WriteEntitiesToClient (client_t *client, edict_t *clent, sizebuf_t *msg) } VectorCopy(ent->v->angles, angles); - if (DotProduct(ent->v->velocity, ent->v->velocity) >= 1.0f && host_client->latency >= 0.01f) - { - VectorMA(ent->v->origin, host_client->latency, ent->v->velocity, origin); - // LordHavoc: trace predicted movement to avoid putting things in walls - trace = SV_Move (ent->v->origin, ent->v->mins, ent->v->maxs, origin, MOVE_NORMAL, ent); - VectorCopy(trace.endpos, origin); - } - else - { - VectorCopy(ent->v->origin, origin); - } + VectorCopy(ent->v->origin, origin); // ent has survived every check so far, check if it is visible // always send embedded brush models, they don't generate much traffic diff --git a/sv_user.c b/sv_user.c index 2d1b5dd9..23c31cbc 100644 --- a/sv_user.c +++ b/sv_user.c @@ -24,7 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. edict_t *sv_player; cvar_t sv_edgefriction = {0, "edgefriction", "2"}; -cvar_t sv_predict = {0, "sv_predict", "1"}; cvar_t sv_deltacompress = {0, "sv_deltacompress", "1"}; cvar_t sv_idealpitchscale = {0, "sv_idealpitchscale","0.8"}; cvar_t sv_maxspeed = {CVAR_NOTIFY, "sv_maxspeed", "320"}; @@ -472,10 +471,6 @@ void SV_ReadClientMove (usercmd_t *move) total += host_client->ping_times[i]; // can be used for prediction host_client->ping = total / NUM_PING_TIMES; - host_client->latency = 0; - // if paused or a local game, don't predict - if (sv_predict.integer && (svs.maxclients > 1) && (!sv.paused)) - host_client->latency = host_client->ping; if ((val = GETEDICTFIELDVALUE(sv_player, eval_ping))) val->_float = host_client->ping * 1000.0; -- 2.39.2