From: havoc Date: Mon, 20 Mar 2006 23:09:24 +0000 (+0000) Subject: fixed stuck entity warnings when they should not have been occurring, by adding trace... X-Git-Tag: xonotic-v0.1.0preview~4171 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8b9682f5e1b81bc4fce815c81b14b41a9935a8d4;p=xonotic%2Fdarkplaces.git fixed stuck entity warnings when they should not have been occurring, by adding trace.bmodelstartsolid as a separate thing to check git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6148 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/collision.h b/collision.h index e2c8e6f2..a2ae0534 100644 --- a/collision.h +++ b/collision.h @@ -15,6 +15,8 @@ typedef struct trace_s int allsolid; // if true, the initial point was in solid (see hitsupercontentsmask) int startsolid; + // this is set to true in world.c if startsolid was set in a trace against a SOLID_BSP entity, in other words this is true if the entity is stuck in a door or wall, but not if stuck in another normal entity + int bmodelstartsolid; // if true, the trace passed through empty somewhere // (set only by Q1BSP tracing) int inopen; diff --git a/sv_phys.c b/sv_phys.c index 12f9b303..15c68026 100644 --- a/sv_phys.c +++ b/sv_phys.c @@ -1289,7 +1289,7 @@ void SV_Physics_Toss (prvm_edict_t *ent) trace = SV_PushEntity (ent, move); if (ent->priv.server->free) return; - if (trace.startsolid) + if (trace.bmodelstartsolid) { // try to unstick the entity SV_UnstickEntity(ent); diff --git a/world.c b/world.c index 98583098..646204f8 100644 --- a/world.c +++ b/world.c @@ -564,6 +564,7 @@ trace_t SV_Move(const vec3_t start, const vec3_t mins, const vec3_t maxs, const // clip to world cliptrace = SV_ClipMoveToWorld(clipstart, clipmins, clipmaxs, clipend, type, hitsupercontentsmask); + cliptrace.startsolid = cliptrace.bmodelstartsolid; if (cliptrace.startsolid || cliptrace.fraction < 1) cliptrace.ent = prog->edicts; if (type == MOVE_WORLDONLY) @@ -661,6 +662,8 @@ trace_t SV_Move(const vec3_t start, const vec3_t mins, const vec3_t maxs, const cliptrace.allsolid = true; if (trace.startsolid) { + if (touch->fields.server->solid == SOLID_BSP) + cliptrace.bmodelstartsolid = true; cliptrace.startsolid = true; if (cliptrace.realfraction == 1) cliptrace.ent = touch; diff --git a/world_cs.c b/world_cs.c index 99be13d8..4a24d25f 100644 --- a/world_cs.c +++ b/world_cs.c @@ -572,6 +572,7 @@ trace_t CSSV_Move(const vec3_t start, const vec3_t mins, const vec3_t maxs, cons // clip to world cliptrace = CSSV_ClipMoveToEntity(prog->edicts, clipstart, clipmins, clipmaxs, clipend, type, hitsupercontentsmask); + cliptrace.bmodelstartsolid = cliptrace.startsolid; if (cliptrace.startsolid || cliptrace.fraction < 1) cliptrace.ent = prog->edicts; if (type == MOVE_WORLDONLY) @@ -669,6 +670,8 @@ trace_t CSSV_Move(const vec3_t start, const vec3_t mins, const vec3_t maxs, cons cliptrace.allsolid = true; if (trace.startsolid) { + if (touch->fields.client->solid == SOLID_BSP) + cliptrace.bmodelstartsolid = true; cliptrace.startsolid = true; if (cliptrace.realfraction == 1) cliptrace.ent = touch;