mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-28 13:21:10 +00:00
Fix sprite-to-plane sorting on sloped FOFs
This commit is contained in:
parent
d138f7e14f
commit
780c568aaf
1 changed files with 12 additions and 4 deletions
|
@ -1752,24 +1752,32 @@ static void R_CreateDrawNodes(void)
|
||||||
{
|
{
|
||||||
if (r2->plane)
|
if (r2->plane)
|
||||||
{
|
{
|
||||||
|
fixed_t planeobjectz;
|
||||||
if (r2->plane->minx > rover->x2 || r2->plane->maxx < rover->x1)
|
if (r2->plane->minx > rover->x2 || r2->plane->maxx < rover->x1)
|
||||||
continue;
|
continue;
|
||||||
if (rover->szt > r2->plane->low || rover->sz < r2->plane->high)
|
if (rover->szt > r2->plane->low || rover->sz < r2->plane->high)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
// Gotta get the plane's height AT THE OBJECT POSITION if we're using slopes -Red
|
||||||
|
planeobjectz =
|
||||||
|
#ifdef ESLOPE
|
||||||
|
r2->plane->slope ? P_GetZAt(r2->plane->slope, rover->gx, rover->gy) :
|
||||||
|
#endif
|
||||||
|
r2->plane->height;
|
||||||
|
|
||||||
if (rover->mobjflags & MF_NOCLIPHEIGHT)
|
if (rover->mobjflags & MF_NOCLIPHEIGHT)
|
||||||
{
|
{
|
||||||
//Objects with NOCLIPHEIGHT can appear halfway in.
|
//Objects with NOCLIPHEIGHT can appear halfway in.
|
||||||
if (r2->plane->height < viewz && rover->pz+(rover->thingheight/2) >= r2->plane->height)
|
if (r2->plane->height < viewz && rover->pz+(rover->thingheight/2) >= planeobjectz)
|
||||||
continue;
|
continue;
|
||||||
if (r2->plane->height > viewz && rover->pzt-(rover->thingheight/2) <= r2->plane->height)
|
if (r2->plane->height > viewz && rover->pzt-(rover->thingheight/2) <= planeobjectz)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (r2->plane->height < viewz && rover->pz >= r2->plane->height)
|
if (r2->plane->height < viewz && rover->pz >= planeobjectz)
|
||||||
continue;
|
continue;
|
||||||
if (r2->plane->height > viewz && rover->pzt <= r2->plane->height)
|
if (r2->plane->height > viewz && rover->pzt <= planeobjectz)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue