From: divverent Date: Mon, 13 Apr 2009 10:16:49 +0000 (+0000) Subject: entity unsticking: verify if the new position REALLY is not in solid (should hide... X-Git-Tag: xonotic-v0.1.0preview~1691 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c9bcf5f88c50b24196138acfef872c25ec472a51;p=xonotic%2Fdarkplaces.git entity unsticking: verify if the new position REALLY is not in solid (should hide and help debugging a pass-through-wall bug with high cl_netfps) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8920 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/sv_phys.c b/sv_phys.c index 6a6dda8c..fd1b8251 100644 --- a/sv_phys.c +++ b/sv_phys.c @@ -519,7 +519,20 @@ static int SV_TestEntityPosition (prvm_edict_t *ent, vec3_t offset) } // if the trace found a better position for the entity, move it there if (VectorDistance2(trace.endpos, ent->fields.server->origin) >= 0.0001) + { +#if 0 + // please switch back to this code when trace.endpos sometimes being in solid bug is fixed VectorCopy(trace.endpos, ent->fields.server->origin); +#else + // verify if the endpos is REALLY outside solid + VectorCopy(trace.endpos, org); + trace = SV_Move (org, ent->fields.server->mins, ent->fields.server->maxs, org, MOVE_NOMONSTERS, ent, SUPERCONTENTS_SOLID); + if(trace.startsolid) + Con_Printf("SV_TestEntityPosition: trace.endpos detected to be in solid. NOT using it.\n"); + else + VectorCopy(org, ent->fields.server->origin); +#endif + } return false; }