From e8ca8a5fd19210b5605c207a04c6dbb8bebe5ef5 Mon Sep 17 00:00:00 2001 From: havoc Date: Mon, 22 Jan 2007 13:22:46 +0000 Subject: [PATCH] improved SV_TestEntityPosition in q1bsp/hlbsp by checking the 8 corner points of the box, this fixes the misaligned double-doors bug in the Prydon Gate expansion "The Dark Age" changed Stuck entity warning from developer 1 to developer 100 because it's annoying and not very helpful git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6721 d7cf8633-e32d-0410-b094-e92efae38249 --- sv_phys.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/sv_phys.c b/sv_phys.c index c00abe7f..e7e5d010 100644 --- a/sv_phys.c +++ b/sv_phys.c @@ -91,7 +91,25 @@ static int SV_TestEntityPosition (prvm_edict_t *ent) if (trace.startsupercontents & SUPERCONTENTS_SOLID) return true; else + { + if (sv.worldmodel->brushq1.hulls && !VectorCompare(ent->fields.server->mins, ent->fields.server->maxs)) + { + // q1bsp/hlbsp use hulls and if the entity does not exactly match + // a hull size it is incorrectly tested, so this code tries to + // 'fix' it slightly... + int i; + vec3_t v; + for (i = 0;i < 8;i++) + { + v[0] = (i & 1) ? ent->fields.server->maxs[0] : ent->fields.server->mins[0]; + v[1] = (i & 2) ? ent->fields.server->maxs[1] : ent->fields.server->mins[1]; + v[2] = (i & 4) ? ent->fields.server->maxs[2] : ent->fields.server->mins[2]; + if (SV_PointSuperContents(v) & SUPERCONTENTS_SOLID) + return true; + } + } return false; + } } /* @@ -1002,7 +1020,8 @@ static void SV_UnstickEntity (prvm_edict_t *ent) } VectorCopy (org, ent->fields.server->origin); - Con_DPrintf("Stuck entity %i (classname \"%s\").\n", (int)PRVM_EDICT_TO_PROG(ent), PRVM_GetString(ent->fields.server->classname)); + if (developer.integer >= 100) + Con_Printf("Stuck entity %i (classname \"%s\").\n", (int)PRVM_EDICT_TO_PROG(ent), PRVM_GetString(ent->fields.server->classname)); } -- 2.39.2