]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fixed stuck entity warnings when they should not have been occurring, by adding trace...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 20 Mar 2006 23:09:24 +0000 (23:09 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 20 Mar 2006 23:09:24 +0000 (23:09 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6148 d7cf8633-e32d-0410-b094-e92efae38249

collision.h
sv_phys.c
world.c
world_cs.c

index e2c8e6f2e70b6e2cddffb86d7745f30b1bbd8b5d..a2ae05345b6bc671efa1ef266fc9548af2acdd8d 100644 (file)
@@ -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;
index 12f9b303e6b67cffd382faf006cd873d6ef69061..15c68026f7f817de0767849a217d71abf687a8ca 100644 (file)
--- 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 985830985448a1ccfe17af159edfe89eec5a8d0b..646204f8e2cb712d5bbd2717651bf544b06fcca4 100644 (file)
--- 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;
index 99be13d89a7019218fe44038024190cca5e5ed0b..4a24d25fafe298f2ae9354bf437b1f37497d967a 100644 (file)
@@ -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;