* Updated to ZDoom r3111:

- Fixed: Spawning things abuve a 3D midtexture did not provess the 'is above midtexture' state properly.
- Fixed: When teleporting an actor the destination must be checked with the new z position, not the old one.

git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1180 b0f79afe-0144-0410-b225-9a4edf0717df
This commit is contained in:
gez 2011-01-21 10:31:43 +00:00
parent ba67099cf6
commit f96905a9c2
6 changed files with 29 additions and 10 deletions

View file

@ -148,10 +148,12 @@ static bool PIT_FindFloorCeiling (line_t *ld, const FBoundingBox &box, FCheckPos
tmf.floorz = open.bottom;
tmf.floorsector = open.bottomsec;
tmf.touchmidtex = open.touchmidtex;
tmf.abovemidtex = open.abovemidtex;
}
else if (open.bottom == tmf.floorz)
{
tmf.touchmidtex |= open.touchmidtex;
tmf.abovemidtex |= open.abovemidtex;
}
if (open.lowfloor < tmf.dropoffz)
@ -250,6 +252,7 @@ void P_FindFloorCeiling (AActor *actor, bool onlyspawnpos)
FBoundingBox box(tmf.x, tmf.y, actor->radius);
tmf.touchmidtex = false;
tmf.abovemidtex = false;
validcount++;
FBlockLinesIterator it(box);
@ -262,7 +265,7 @@ void P_FindFloorCeiling (AActor *actor, bool onlyspawnpos)
if (tmf.touchmidtex) tmf.dropoffz = tmf.floorz;
if (!onlyspawnpos || (tmf.touchmidtex && (tmf.floorz <= actor->z)))
if (!onlyspawnpos || (tmf.abovemidtex && (tmf.floorz <= actor->z)))
{
actor->floorz = tmf.floorz;
actor->dropoffz = tmf.dropoffz;
@ -314,6 +317,8 @@ bool P_TeleportMove (AActor *thing, fixed_t x, fixed_t y, fixed_t z, bool telefr
tmf.x = x;
tmf.y = y;
tmf.z = z;
tmf.touchmidtex = false;
tmf.abovemidtex = false;
P_GetFloorCeilingZ(tmf, true);
spechit.Clear ();
@ -325,10 +330,14 @@ bool P_TeleportMove (AActor *thing, fixed_t x, fixed_t y, fixed_t z, bool telefr
FBlockLinesIterator it(box);
line_t *ld;
// P_LineOpening requires the thing's z to be the destination ín order to work.
fixed_t savedz = thing->z;
thing->z = z;
while ((ld = it.Next()))
{
PIT_FindFloorCeiling(ld, box, tmf);
}
thing->z = savedz;
if (tmf.touchmidtex) tmf.dropoffz = tmf.floorz;
@ -768,11 +777,13 @@ bool PIT_CheckLine (line_t *ld, const FBoundingBox &box, FCheckPosition &tm)
tm.floorsector = open.bottomsec;
tm.floorpic = open.floorpic;
tm.touchmidtex = open.touchmidtex;
tm.abovemidtex = open.abovemidtex;
tm.thing->BlockingLine = ld;
}
else if (open.bottom == tm.floorz)
{
tm.touchmidtex |= open.touchmidtex;
tm.abovemidtex |= open.abovemidtex;
}
if (open.lowfloor < tm.dropoffz)
@ -1258,6 +1269,7 @@ bool P_CheckPosition (AActor *thing, fixed_t x, fixed_t y, FCheckPosition &tm)
tm.ceilingpic = newsec->GetTexture(sector_t::ceiling);
tm.ceilingsector = newsec;
tm.touchmidtex = false;
tm.abovemidtex = false;
//Added by MC: Fill the tmsector.
tm.sector = newsec;
@ -2864,7 +2876,8 @@ bool aim_t::AimTraverse3DFloors(const divline_t &trace, intercept_t * in)
nextsector=NULL;
nexttopplane=nextbottomplane=NULL;
if(li->frontsector->e->XFloor.ffloors.Size() || li->backsector->e->XFloor.ffloors.Size())
if (li->backsector == NULL) return true; // shouldn't really happen but crashed once for me...
if (li->frontsector->e->XFloor.ffloors.Size() || li->backsector->e->XFloor.ffloors.Size())
{
int frontflag;
F3DFloor* rover;