Skip to content
Snippets Groups Projects
Commit c8c7c870 authored by Monster Iestyn's avatar Monster Iestyn
Browse files

Prioritise regular FOF tops over FF_DOUBLESHADOW bottoms in R_Prep3DFloors, if...

Prioritise regular FOF tops over FF_DOUBLESHADOW bottoms in R_Prep3DFloors, if they are at the same heights. Also optimise code for handling FF_DOUBLESHADOW bottoms a bit.

(there are problems in ERZ2's timed gravity flipping room mind, I'll have to check I've not done anything wrong before deciding whether to add this to 2.1 or not)
parent 1fcf1214
No related branches found
No related tags found
No related merge requests found
......@@ -1289,6 +1289,7 @@ void R_Prep3DFloors(sector_t *sector)
{
bestheight = INT32_MAX * -1;
best = NULL;
doubleshadowbottom = false;
for (rover = sector->ffloors; rover; rover = rover->next)
{
rover->lastlight = 0;
......@@ -1299,7 +1300,8 @@ void R_Prep3DFloors(sector_t *sector)
#ifdef ESLOPE
heighttest = *rover->t_slope ? P_GetZAt(*rover->t_slope, sector->soundorg.x, sector->soundorg.y) : *rover->topheight;
if (heighttest > bestheight && heighttest < maxheight)
if ((heighttest > bestheight && heighttest < maxheight)
|| (heighttest == bestheight && doubleshadowbottom)) // override bottoms of doubleshadow FOFs
{
best = rover;
bestheight = heighttest;
......@@ -1321,7 +1323,8 @@ void R_Prep3DFloors(sector_t *sector)
}
}
#else
if (*rover->topheight > bestheight && *rover->topheight < maxheight)
if ((*rover->topheight > bestheight && *rover->topheight < maxheight)
|| (*rover->topheight == bestheight && doubleshadowbottom)) // override bottoms of doubleshadow FOFs
{
best = rover;
bestheight = *rover->topheight;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment