Actually remove the entire code block in T_MovePlane(), and remove line_t.tagline as it served no other purpose.
This commit is contained in:
parent
711c35970c
commit
74bd23c275
101
src/p_floor.c
101
src/p_floor.c
|
@ -48,8 +48,6 @@ result_e T_MovePlane(sector_t *sector, fixed_t speed, fixed_t dest, boolean crus
|
||||||
boolean flag;
|
boolean flag;
|
||||||
fixed_t lastpos;
|
fixed_t lastpos;
|
||||||
fixed_t destheight; // used to keep floors/ceilings from moving through each other
|
fixed_t destheight; // used to keep floors/ceilings from moving through each other
|
||||||
mobj_t *mo = NULL;
|
|
||||||
|
|
||||||
sector->moved = true;
|
sector->moved = true;
|
||||||
|
|
||||||
switch (floorOrCeiling)
|
switch (floorOrCeiling)
|
||||||
|
@ -187,105 +185,6 @@ result_e T_MovePlane(sector_t *sector, fixed_t speed, fixed_t dest, boolean crus
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If this is an FOF being checked, check all the affected sectors for moving mobjs.
|
|
||||||
if (sector->tagline)
|
|
||||||
{
|
|
||||||
boolean sectorisquicksand = false;
|
|
||||||
sector_t *sec;
|
|
||||||
ffloor_t *rover;
|
|
||||||
INT32 secnum;
|
|
||||||
|
|
||||||
while (secnum = P_FindSectorFromLineTag(sector->tagline, secnum) >= 0)
|
|
||||||
{
|
|
||||||
// Get actual sector from the list of sectors.
|
|
||||||
sec = §ors[secnum];
|
|
||||||
|
|
||||||
if (!sec->thinglist)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// Can't use P_InQuicksand because it will return the incorrect result
|
|
||||||
// because of checking for heights.
|
|
||||||
for (rover = sec->ffloors; rover; rover = rover->next)
|
|
||||||
{
|
|
||||||
if (rover->target == sec && (rover->flags & FF_QUICKSAND))
|
|
||||||
{
|
|
||||||
sectorisquicksand = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (mo = sec->thinglist; mo; mo = mo->snext)
|
|
||||||
{
|
|
||||||
// The object should be ready to move as defined by this function.
|
|
||||||
if (!P_MobjReadyToMove(mo, sec, true, sectorisquicksand))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// The object should not be moving at all.
|
|
||||||
if (mo->momx || mo->momy || mo->momz)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// These objects will be affected by this condition.
|
|
||||||
switch (mo->type)
|
|
||||||
{
|
|
||||||
case MT_GOOP: // Egg Slimer's goop objects
|
|
||||||
case MT_SPINFIRE: // Elemental Shield flame balls
|
|
||||||
case MT_SPIKE: // Floor Spike
|
|
||||||
// Is the object hang from the ceiling?
|
|
||||||
// In that case, swap the planes used.
|
|
||||||
// verticalflip inverts
|
|
||||||
if (!!(mo->flags & MF_SPAWNCEILING) ^ !!(mo->eflags & MFE_VERTICALFLIP))
|
|
||||||
{
|
|
||||||
if (!sectorisquicksand)
|
|
||||||
mo->z = mo->ceilingz - mo->height;
|
|
||||||
else
|
|
||||||
mo->z = mo->ceilingz = mo->subsector->sector->ceilingheight - mo->height;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (!sectorisquicksand)
|
|
||||||
mo->z = mo->floorz;
|
|
||||||
else
|
|
||||||
mo->z = mo->floorz = mo->subsector->sector->floorheight;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Only run the logic if there is any mobjs in the sector.
|
|
||||||
if (sector->thinglist)
|
|
||||||
for (mo = sector->thinglist; mo; mo = mo->snext)
|
|
||||||
{
|
|
||||||
// The object should be ready to move as defined by this function.
|
|
||||||
if (!P_MobjReadyToMove(mo, sector, false, false))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// The object should not be moving at all.
|
|
||||||
if (mo->momx || mo->momy || mo->momz)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// These objects will be affected by this condition.
|
|
||||||
switch (mo->type)
|
|
||||||
{
|
|
||||||
case MT_GOOP: // Egg Slimer's goop objects
|
|
||||||
case MT_SPINFIRE: // Elemental Shield flame balls
|
|
||||||
case MT_SPIKE: // Floor Spike
|
|
||||||
// Is the object hang from the ceiling?
|
|
||||||
// In that case, swap the planes used.
|
|
||||||
// verticalflip inverts
|
|
||||||
if (!!(mo->flags & MF_SPAWNCEILING) ^ !!(mo->eflags & MFE_VERTICALFLIP))
|
|
||||||
mo->z = mo->ceilingz = mo->subsector->sector->ceilingheight - mo->height;
|
|
||||||
else
|
|
||||||
mo->z = mo->floorz = mo->subsector->sector->floorheight;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -872,7 +872,6 @@ static void P_InitializeSector(sector_t *ss)
|
||||||
|
|
||||||
ss->linecount = 0;
|
ss->linecount = 0;
|
||||||
ss->lines = NULL;
|
ss->lines = NULL;
|
||||||
ss->tagline = NULL;
|
|
||||||
|
|
||||||
ss->ffloors = NULL;
|
ss->ffloors = NULL;
|
||||||
ss->attached = NULL;
|
ss->attached = NULL;
|
||||||
|
|
|
@ -5772,8 +5772,6 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, f
|
||||||
sec2->floorheight = tempceiling;
|
sec2->floorheight = tempceiling;
|
||||||
}
|
}
|
||||||
|
|
||||||
sec2->tagline = master;
|
|
||||||
|
|
||||||
if (sec2->numattached == 0)
|
if (sec2->numattached == 0)
|
||||||
{
|
{
|
||||||
sec2->attached = Z_Malloc(sizeof (*sec2->attached) * sec2->maxattached, PU_STATIC, NULL);
|
sec2->attached = Z_Malloc(sizeof (*sec2->attached) * sec2->maxattached, PU_STATIC, NULL);
|
||||||
|
|
|
@ -328,11 +328,6 @@ typedef struct sector_s
|
||||||
|
|
||||||
size_t linecount;
|
size_t linecount;
|
||||||
struct line_s **lines; // [linecount] size
|
struct line_s **lines; // [linecount] size
|
||||||
// Hack: store special line tagging to some sectors
|
|
||||||
// to efficiently help work around bugs by directly
|
|
||||||
// referencing the specific line that the problem happens in.
|
|
||||||
// (used in T_MovePlane mobj physics)
|
|
||||||
struct line_s *tagline;
|
|
||||||
|
|
||||||
// Improved fake floor hack
|
// Improved fake floor hack
|
||||||
ffloor_t *ffloors;
|
ffloor_t *ffloors;
|
||||||
|
|
Loading…
Reference in New Issue