mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 20:41:46 +00:00
Fix FOF shadows again
This commit is contained in:
parent
9a24f65cb8
commit
f3f0b5edda
1 changed files with 52 additions and 17 deletions
69
src/p_mobj.c
69
src/p_mobj.c
|
|
@ -6264,7 +6264,8 @@ void P_RunShadows(void)
|
||||||
|
|
||||||
for (rover = sec->ffloors; rover; rover = rover->next)
|
for (rover = sec->ffloors; rover; rover = rover->next)
|
||||||
{
|
{
|
||||||
fixed_t surface;
|
fixed_t top, bottom;
|
||||||
|
fixed_t d1, d2;
|
||||||
|
|
||||||
if (!(rover->flags & FF_EXISTS))
|
if (!(rover->flags & FF_EXISTS))
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -6275,17 +6276,41 @@ void P_RunShadows(void)
|
||||||
|| (rover->flags & FF_SWIMMABLE)))
|
|| (rover->flags & FF_SWIMMABLE)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
#ifdef ESLOPE
|
||||||
|
if (*rover->t_slope)
|
||||||
|
top = P_GetZAt(*rover->t_slope, mobj->target->x, mobj->target->y);
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
top = *rover->topheight;
|
||||||
|
|
||||||
|
#ifdef ESLOPE
|
||||||
|
if (*rover->b_slope)
|
||||||
|
bottom = P_GetZAt(*rover->b_slope, mobj->target->x, mobj->target->y);
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
bottom = *rover->bottomheight;
|
||||||
|
|
||||||
if (flip)
|
if (flip)
|
||||||
{
|
{
|
||||||
surface = *rover->bottomheight;
|
if (rover->flags & FF_QUICKSAND)
|
||||||
#ifdef ESLOPE
|
|
||||||
if (*rover->b_slope)
|
|
||||||
surface = P_GetZAt(*rover->b_slope, mobj->target->x, mobj->target->y);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (surface < newz && surface > (mobj->target->z + mobj->target->height))
|
|
||||||
{
|
{
|
||||||
newz = surface;
|
if (mobj->target->z < top && (mobj->target->z + mobj->target->height) > bottom)
|
||||||
|
{
|
||||||
|
if (newz > (mobj->target->z + mobj->target->height))
|
||||||
|
{
|
||||||
|
newz = (mobj->target->z + mobj->target->height);
|
||||||
|
slope = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
d1 = (mobj->target->z + mobj->target->height) - (top + ((bottom - top)/2));
|
||||||
|
d2 = mobj->target->z - (top + ((bottom - top)/2));
|
||||||
|
|
||||||
|
if (bottom < newz && abs(d1) < abs(d2))
|
||||||
|
{
|
||||||
|
newz = bottom;
|
||||||
#ifdef ESLOPE
|
#ifdef ESLOPE
|
||||||
if (*rover->b_slope)
|
if (*rover->b_slope)
|
||||||
slope = *rover->b_slope;
|
slope = *rover->b_slope;
|
||||||
|
|
@ -6294,15 +6319,25 @@ void P_RunShadows(void)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
surface = *rover->topheight;
|
if (rover->flags & FF_QUICKSAND)
|
||||||
#ifdef ESLOPE
|
|
||||||
if (*rover->t_slope)
|
|
||||||
surface = P_GetZAt(*rover->t_slope, mobj->target->x, mobj->target->y);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (surface > newz && surface < mobj->target->z)
|
|
||||||
{
|
{
|
||||||
newz = surface;
|
if (mobj->target->z < top && (mobj->target->z + mobj->target->height) > bottom)
|
||||||
|
{
|
||||||
|
if (newz < mobj->target->z)
|
||||||
|
{
|
||||||
|
newz = mobj->target->z;
|
||||||
|
slope = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
d1 = mobj->target->z - (bottom + ((top - bottom)/2));
|
||||||
|
d2 = (mobj->target->z + mobj->target->height) - (bottom + ((top - bottom)/2));
|
||||||
|
|
||||||
|
if (top > newz && abs(d1) < abs(d2))
|
||||||
|
{
|
||||||
|
newz = top;
|
||||||
#ifdef ESLOPE
|
#ifdef ESLOPE
|
||||||
if (*rover->t_slope)
|
if (*rover->t_slope)
|
||||||
slope = *rover->t_slope;
|
slope = *rover->t_slope;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue