mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-18 07:22:28 +00:00
Lava is now either completely solid or completely intangible. No more half-assing
This commit is contained in:
parent
24e80c9b23
commit
5c1fabfaae
6 changed files with 11 additions and 29 deletions
|
@ -802,15 +802,12 @@ static int lib_pCheckDeathPitCollide(lua_State *L)
|
|||
|
||||
static int lib_pCheckSolidLava(lua_State *L)
|
||||
{
|
||||
mobj_t *mo = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||
ffloor_t *rover = *((ffloor_t **)luaL_checkudata(L, 2, META_FFLOOR));
|
||||
//HUDSAFE
|
||||
INLEVEL
|
||||
if (!mo)
|
||||
return LUA_ErrInvalid(L, "mobj_t");
|
||||
if (!rover)
|
||||
return LUA_ErrInvalid(L, "ffloor_t");
|
||||
lua_pushboolean(L, P_CheckSolidLava(mo, rover));
|
||||
lua_pushboolean(L, P_CheckSolidLava(rover));
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -303,7 +303,7 @@ fixed_t P_CameraCeilingZ(camera_t *mobj, sector_t *sector, sector_t *boundsec, f
|
|||
|
||||
boolean P_InsideANonSolidFFloor(mobj_t *mobj, ffloor_t *rover);
|
||||
boolean P_CheckDeathPitCollide(mobj_t *mo);
|
||||
boolean P_CheckSolidLava(mobj_t *mo, ffloor_t *rover);
|
||||
boolean P_CheckSolidLava(ffloor_t *rover);
|
||||
void P_AdjustMobjFloorZ_FFloors(mobj_t *mo, sector_t *sector, UINT8 motype);
|
||||
|
||||
mobj_t *P_SpawnMobjFromMobj(mobj_t *mobj, fixed_t xofs, fixed_t yofs, fixed_t zofs, mobjtype_t type);
|
||||
|
|
|
@ -2055,7 +2055,7 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
|
|||
continue;
|
||||
}
|
||||
|
||||
if (thing->player && (P_CheckSolidLava(thing, rover) || P_CanRunOnWater(thing->player, rover)))
|
||||
if (thing->player && (P_CheckSolidLava(rover) || P_CanRunOnWater(thing->player, rover)))
|
||||
;
|
||||
else if (thing->type == MT_SKIM && (rover->flags & FF_SWIMMABLE))
|
||||
;
|
||||
|
@ -3589,9 +3589,6 @@ static void P_CheckLavaWall(mobj_t *mo, sector_t *sec)
|
|||
if (GETSECSPECIAL(rover->master->frontsector->special, 1) != 3)
|
||||
continue;
|
||||
|
||||
if (!(rover->master->flags & ML_EFFECT3))
|
||||
continue;
|
||||
|
||||
if (rover->master->flags & ML_BLOCKMONSTERS)
|
||||
continue;
|
||||
|
||||
|
|
|
@ -662,7 +662,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
|
|||
if (!(rover->flags & FF_EXISTS))
|
||||
continue;
|
||||
|
||||
if (mobj->player && (P_CheckSolidLava(mobj, rover) || P_CanRunOnWater(mobj->player, rover)))
|
||||
if (mobj->player && (P_CheckSolidLava(rover) || P_CanRunOnWater(mobj->player, rover)))
|
||||
;
|
||||
else if (!((rover->flags & FF_BLOCKPLAYER && mobj->player)
|
||||
|| (rover->flags & FF_BLOCKOTHERS && !mobj->player)))
|
||||
|
@ -708,7 +708,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
|
|||
if (!(rover->flags & FF_EXISTS))
|
||||
continue;
|
||||
|
||||
if (mobj->player && (P_CheckSolidLava(mobj, rover) || P_CanRunOnWater(mobj->player, rover)))
|
||||
if (mobj->player && (P_CheckSolidLava(rover) || P_CanRunOnWater(mobj->player, rover)))
|
||||
;
|
||||
else if (!((rover->flags & FF_BLOCKPLAYER && mobj->player)
|
||||
|| (rover->flags & FF_BLOCKOTHERS && !mobj->player)))
|
||||
|
|
22
src/p_mobj.c
22
src/p_mobj.c
|
@ -2222,7 +2222,7 @@ void P_AdjustMobjFloorZ_FFloors(mobj_t *mo, sector_t *sector, UINT8 motype)
|
|||
topheight = P_GetFOFTopZ(mo, sector, rover, mo->x, mo->y, NULL);
|
||||
bottomheight = P_GetFOFBottomZ(mo, sector, rover, mo->x, mo->y, NULL);
|
||||
|
||||
if (mo->player && (P_CheckSolidLava(mo, rover) || P_CanRunOnWater(mo->player, rover))) // only the player should stand on lava or run on water
|
||||
if (mo->player && (P_CheckSolidLava(rover) || P_CanRunOnWater(mo->player, rover))) // only the player should stand on lava or run on water
|
||||
;
|
||||
else if (motype != 0 && rover->flags & FF_SWIMMABLE) // "scenery" only
|
||||
continue;
|
||||
|
@ -2379,23 +2379,11 @@ boolean P_CheckDeathPitCollide(mobj_t *mo)
|
|||
return false;
|
||||
}
|
||||
|
||||
boolean P_CheckSolidLava(mobj_t *mo, ffloor_t *rover)
|
||||
boolean P_CheckSolidLava(ffloor_t *rover)
|
||||
{
|
||||
I_Assert(mo != NULL);
|
||||
I_Assert(!P_MobjWasRemoved(mo));
|
||||
|
||||
{
|
||||
fixed_t topheight =
|
||||
#ifdef ESLOPE
|
||||
*rover->t_slope ? P_GetZAt(*rover->t_slope, mo->x, mo->y) :
|
||||
#endif
|
||||
*rover->topheight;
|
||||
|
||||
if (rover->flags & FF_SWIMMABLE && GETSECSPECIAL(rover->master->frontsector->special, 1) == 3
|
||||
&& !(rover->master->flags & ML_BLOCKMONSTERS)
|
||||
&& ((rover->master->flags & ML_EFFECT3) || mo->z-mo->momz > topheight - FixedMul(16*FRACUNIT, mo->scale)))
|
||||
return true;
|
||||
}
|
||||
if (rover->flags & FF_SWIMMABLE && GETSECSPECIAL(rover->master->frontsector->special, 1) == 3
|
||||
&& !(rover->master->flags & ML_BLOCKMONSTERS))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -3683,7 +3683,7 @@ static void P_DoTeeter(player_t *player)
|
|||
bottomheight = *rover->bottomheight;
|
||||
#endif
|
||||
|
||||
if (P_CheckSolidLava(player->mo, rover))
|
||||
if (P_CheckSolidLava(rover))
|
||||
;
|
||||
else if (!(rover->flags & FF_BLOCKPLAYER || rover->flags & FF_QUICKSAND))
|
||||
continue; // intangible 3d floor
|
||||
|
|
Loading…
Reference in a new issue