mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-10 14:51:46 +00:00
- 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. SVN r3111 (trunk)
This commit is contained in:
parent
f21d035dcb
commit
622d1ebe6a
5 changed files with 27 additions and 8 deletions
|
@ -256,10 +256,11 @@ bool P_GetMidTexturePosition(const line_t *line, int sideno, fixed_t *ptextop, f
|
|||
//
|
||||
//============================================================================
|
||||
|
||||
bool P_LineOpening_3dMidtex(AActor *thing, const line_t *linedef, fixed_t &opentop, fixed_t &openbottom)
|
||||
bool P_LineOpening_3dMidtex(AActor *thing, const line_t *linedef, fixed_t &opentop, fixed_t &openbottom, bool *above)
|
||||
{
|
||||
fixed_t tt, tb;
|
||||
|
||||
*above = false;
|
||||
if (P_GetMidTexturePosition(linedef, 0, &tt, &tb))
|
||||
{
|
||||
if (thing->z + (thing->height/2) < (tt + tb)/2)
|
||||
|
@ -268,8 +269,11 @@ bool P_LineOpening_3dMidtex(AActor *thing, const line_t *linedef, fixed_t &opent
|
|||
}
|
||||
else
|
||||
{
|
||||
if(tt > openbottom) openbottom = tt;
|
||||
|
||||
if(tt > openbottom)
|
||||
{
|
||||
openbottom = tt;
|
||||
*above = true;
|
||||
}
|
||||
// returns true if it touches the midtexture
|
||||
return (abs(thing->z - tt) <= thing->MaxStepHeight);
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ void P_Start3dMidtexInterpolations(TArray<DInterpolation *> &list, sector_t *sec
|
|||
void P_Attach3dMidtexLinesToSector(sector_t *dest, int lineid, int tag, bool ceiling);
|
||||
bool P_GetMidTexturePosition(const line_t *line, int sideno, fixed_t *ptextop, fixed_t *ptexbot);
|
||||
bool P_Check3dMidSwitch(AActor *actor, line_t *line, int side);
|
||||
bool P_LineOpening_3dMidtex(AActor *thing, const line_t *linedef, fixed_t &opentop, fixed_t &openbottom);
|
||||
bool P_LineOpening_3dMidtex(AActor *thing, const line_t *linedef, fixed_t &opentop, fixed_t &openbottom, bool *above);
|
||||
|
||||
bool P_MoveLinkedSectors(sector_t *sector, int crush, fixed_t move, bool ceiling);
|
||||
void P_StartLinkedSectorInterpolations(TArray<DInterpolation *> &list, sector_t *sector, bool ceiling);
|
||||
|
|
|
@ -232,6 +232,7 @@ struct FLineOpening
|
|||
FTextureID ceilingpic;
|
||||
FTextureID floorpic;
|
||||
bool touchmidtex;
|
||||
bool abovemidtex;
|
||||
};
|
||||
|
||||
void P_LineOpening (FLineOpening &open, AActor *thing, const line_t *linedef, fixed_t x, fixed_t y, fixed_t refx=FIXED_MIN, fixed_t refy=0);
|
||||
|
@ -348,6 +349,7 @@ struct FCheckPosition
|
|||
FTextureID ceilingpic;
|
||||
sector_t *ceilingsector;
|
||||
bool touchmidtex;
|
||||
bool abovemidtex;
|
||||
bool floatok;
|
||||
bool FromPMove;
|
||||
line_t *ceilingline;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -212,9 +212,9 @@ void P_LineOpening (FLineOpening &open, AActor *actor, const line_t *linedef,
|
|||
if (actor != NULL && linedef->frontsector != NULL && linedef->backsector != NULL &&
|
||||
linedef->flags & ML_3DMIDTEX)
|
||||
{
|
||||
open.touchmidtex = P_LineOpening_3dMidtex(actor, linedef, open.top, open.bottom);
|
||||
open.touchmidtex = P_LineOpening_3dMidtex(actor, linedef, open.top, open.bottom, &open.abovemidtex);
|
||||
}
|
||||
else open.touchmidtex = false;
|
||||
else open.abovemidtex = open.touchmidtex = false;
|
||||
|
||||
open.range = open.top - open.bottom;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue