diff --git a/docs/rh-log.txt b/docs/rh-log.txt index b6b6cf588..2cd47564c 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,5 @@ May 17, 2008 (Changes by Graf Zahl) +- Fixed coordinate checks for objects on 3DMidtex lines. - Fixed: All translucent blending operations for CopyColors must treat an alpha of 0 so that the pixel is not modified or texture composition as intended will not work. diff --git a/src/p_map.cpp b/src/p_map.cpp index 88eb13a14..c4ac9d5f3 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -150,6 +150,10 @@ static bool PIT_FindFloorCeiling (line_t *ld, const FBoundingBox &box, FCheckPos tmf.floorsector = open.bottomsec; tmf.touchmidtex = open.touchmidtex; } + else if (open.bottom == tmf.floorz) + { + tmf.touchmidtex |= open.touchmidtex; + } if (open.lowfloor < tmf.dropoffz) tmf.dropoffz = open.lowfloor; @@ -194,7 +198,7 @@ void P_FindFloorCeiling (AActor *actor, bool onlymidtex) if (tmf.touchmidtex) tmf.dropoffz = tmf.floorz; - if (!onlymidtex || (tmf.touchmidtex && (tmf.floorz < actor->z))) + if (!onlymidtex || (tmf.touchmidtex && (tmf.floorz <= actor->z))) { actor->floorz = tmf.floorz; actor->dropoffz = tmf.dropoffz; @@ -629,6 +633,10 @@ bool PIT_CheckLine (line_t *ld, const FBoundingBox &box, FCheckPosition &tm) tm.touchmidtex = open.touchmidtex; tm.thing->BlockingLine = ld; } + else if (open.bottom == tm.floorz) + { + tm.touchmidtex |= open.touchmidtex; + } if (open.lowfloor < tm.dropoffz) tm.dropoffz = open.lowfloor; @@ -1133,7 +1141,11 @@ bool P_CheckPosition (AActor *thing, fixed_t x, fixed_t y, FCheckPosition &tm) if (tm.ceilingz - tm.floorz < thing->height) return false; - if (tm.stepthing != NULL || tm.touchmidtex) + if (tm.touchmidtex) + { + tm.dropoffz = tm.floorz; + } + else if (tm.stepthing != NULL) { tm.dropoffz = thingdropoffz; } diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 08f1a5f62..d4b172d91 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -1758,7 +1758,12 @@ explode: || mo->momy > FRACUNIT/4 || mo->momy < -FRACUNIT/4) { if (mo->floorz > mo->Sector->floorplane.ZatPoint (mo->x, mo->y)) - return; + { + if (mo->dropoffz != mo->floorz) // 3DMidtex or other special cases that must be excluded + { + return; + } + } } } @@ -4029,6 +4034,7 @@ AActor *P_SpawnMapThing (FMapThing *mthing, int position) mobj->SpawnPoint[2] = mthing->z; mobj->SpawnAngle = mthing->angle; mobj->SpawnFlags = mthing->flags; + P_FindFloorCeiling(mobj, true); if (!(mobj->flags2 & MF2_ARGSDEFINED)) {