Fix solidity of lava in reverse gravity. (Resolves #216)
This commit is contained in:
parent
9d774f7578
commit
e993b8981e
38
src/p_mobj.c
38
src/p_mobj.c
|
@ -2381,22 +2381,42 @@ boolean P_CheckDeathPitCollide(mobj_t *mo)
|
||||||
|
|
||||||
boolean P_CheckSolidLava(mobj_t *mo, ffloor_t *rover)
|
boolean P_CheckSolidLava(mobj_t *mo, ffloor_t *rover)
|
||||||
{
|
{
|
||||||
|
fixed_t topheight;
|
||||||
|
|
||||||
I_Assert(mo != NULL);
|
I_Assert(mo != NULL);
|
||||||
I_Assert(!P_MobjWasRemoved(mo));
|
I_Assert(!P_MobjWasRemoved(mo));
|
||||||
|
|
||||||
{
|
// not a lava block with solid planes
|
||||||
fixed_t topheight =
|
if (!(rover->flags & FF_SWIMMABLE && GETSECSPECIAL(rover->master->frontsector->special, 1) == 3
|
||||||
#ifdef ESLOPE
|
&& !(rover->master->flags & ML_BLOCKMONSTERS)))
|
||||||
*rover->t_slope ? P_GetZAt(*rover->t_slope, mo->x, mo->y) :
|
return false;
|
||||||
#endif
|
|
||||||
*rover->topheight;
|
|
||||||
|
|
||||||
if (rover->flags & FF_SWIMMABLE && GETSECSPECIAL(rover->master->frontsector->special, 1) == 3
|
// is solid from the sides
|
||||||
&& !(rover->master->flags & ML_BLOCKMONSTERS)
|
if (rover->master->flags & ML_EFFECT3)
|
||||||
&& ((rover->master->flags & ML_EFFECT3) || mo->z-mo->momz > topheight - FixedMul(16*FRACUNIT, mo->scale)))
|
return true;
|
||||||
|
|
||||||
|
if (mo->eflags & MFE_VERTICALFLIP)
|
||||||
|
{
|
||||||
|
topheight =
|
||||||
|
#ifdef ESLOPE
|
||||||
|
*rover->b_slope ? P_GetZAt(*rover->b_slope, mo->x, mo->y) :
|
||||||
|
#endif
|
||||||
|
*rover->bottomheight;
|
||||||
|
|
||||||
|
if (mo->z+mo->height-mo->momz < topheight + FixedMul(16*FRACUNIT, mo->scale))
|
||||||
return true;
|
return true;
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
topheight =
|
||||||
|
#ifdef ESLOPE
|
||||||
|
*rover->t_slope ? P_GetZAt(*rover->t_slope, mo->x, mo->y) :
|
||||||
|
#endif
|
||||||
|
*rover->topheight;
|
||||||
|
|
||||||
|
if (mo->z-mo->momz > topheight - FixedMul(16*FRACUNIT, mo->scale))
|
||||||
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue