Merge branch 'polyobj-teeter-fix' into 'next'

Fix for teetering on PolyObjects

So... somebody goofed and didn't realise PolyObject sectors could be added to the sector node list for each object (which is referenced by mobj->touching_sectorlist), via their linedefs if they are nearby the player (yes, PolyObject linedefs are special and get to move about the level). As it turns out, this allows even INTANGIBLE PolyObjects to make you teeter in a seemingly inexplicable way.

What is happening is that PolyObject sectors, when they are added to the mentioned lists, are then checked under normal sector teetering conditions - if the player is above the floorheight by 24 FUs, you're officially teetering unless stated otherwise. The actual PolyObject teetering code can't help you here if the conditions are right, especially if they're taller than 24 FU in height.

There are a number of things wrong with the teetering code in general that I'd like to sort eventually, but at least now teetering on PolyObjects is fixed at last ...right? Please check the branch out if you can to check this, obviously.

See merge request !54
This commit is contained in:
Inuyasha 2016-03-31 20:55:28 -04:00
commit 816990a3ed
2 changed files with 8 additions and 2 deletions

View file

@ -3712,6 +3712,9 @@ static inline boolean PIT_GetSectors(line_t *ld)
if (P_BoxOnLineSide(tmbbox, ld) != -1)
return true;
if (ld->polyobj) // line belongs to a polyobject, don't add it
return true;
// This line crosses through the object.
// Collect the sector(s) from the line and add to the
@ -3744,6 +3747,9 @@ static inline boolean PIT_GetPrecipSectors(line_t *ld)
if (P_BoxOnLineSide(preciptmbbox, ld) != -1)
return true;
if (ld->polyobj) // line belongs to a polyobject, don't add it
return true;
// This line crosses through the object.
// Collect the sector(s) from the line and add to the

View file

@ -3087,7 +3087,7 @@ static void P_DoTeeter(player_t *player)
}
if (polybottom > player->mo->z + player->mo->height + tiptop
|| (polybottom < player->mo->z
|| (polytop < player->mo->z
&& player->mo->z + player->mo->height < player->mo->ceilingz - tiptop))
teeter = true;
else
@ -3105,7 +3105,7 @@ static void P_DoTeeter(player_t *player)
}
if (polytop < player->mo->z - tiptop
|| (polytop > player->mo->z + player->mo->height
|| (polybottom > player->mo->z + player->mo->height
&& player->mo->z > player->mo->floorz + tiptop))
teeter = true;
else