Fix kart gibs bouncing off death pit FOFs
This commit is contained in:
parent
500790ef64
commit
7ebda658f6
5 changed files with 34 additions and 12 deletions
|
|
@ -363,8 +363,9 @@ fixed_t P_CameraCeilingZ(camera_t *mobj, sector_t *sector, sector_t *boundsec, f
|
|||
INT32 P_FloorPicAtPos(fixed_t x, fixed_t y, fixed_t z, fixed_t height);
|
||||
|
||||
boolean P_InsideANonSolidFFloor(mobj_t *mobj, ffloor_t *rover);
|
||||
boolean P_CheckDeathPitCollide(mobj_t *mo);
|
||||
boolean P_CheckDeathPitCollide(const mobj_t *mo);
|
||||
boolean P_CheckSolidLava(ffloor_t *rover);
|
||||
boolean P_CheckDeathPitFOFs(const mobj_t *mo);
|
||||
void P_AdjustMobjFloorZ_FFloors(mobj_t *mo, sector_t *sector, UINT8 motype);
|
||||
|
||||
mobj_t *P_SpawnMobjFromMobjUnscaled(mobj_t *mobj, fixed_t xofs, fixed_t yofs, fixed_t zofs, mobjtype_t type);
|
||||
|
|
|
|||
27
src/p_mobj.c
27
src/p_mobj.c
|
|
@ -2162,7 +2162,7 @@ void P_RingZMovement(mobj_t *mo)
|
|||
}
|
||||
}
|
||||
|
||||
boolean P_CheckDeathPitCollide(mobj_t *mo)
|
||||
boolean P_CheckDeathPitCollide(const mobj_t *mo)
|
||||
{
|
||||
I_Assert(mo != NULL);
|
||||
I_Assert(!P_MobjWasRemoved(mo));
|
||||
|
|
@ -2197,6 +2197,25 @@ boolean P_CheckSolidLava(ffloor_t *rover)
|
|||
return false;
|
||||
}
|
||||
|
||||
boolean P_CheckDeathPitFOFs(const mobj_t *mo)
|
||||
{
|
||||
if (P_CheckDeathPitCollide(mo))
|
||||
return true;
|
||||
|
||||
const sector_t *sector = mo->subsector->sector;
|
||||
|
||||
for (ffloor_t *rover = sector->ffloors; rover != NULL; rover = rover->next)
|
||||
{
|
||||
// i... think these are the right checks?
|
||||
if (rover->fofflags & FOF_EXISTS
|
||||
&& rover->master->frontsector->damagetype == SD_DEATHPIT
|
||||
&& P_IsMobjTouching3DFloor(mo, rover, sector))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
// P_ZMovement
|
||||
// Returns false if the mobj was killed/exploded/removed, true otherwise.
|
||||
|
|
@ -2440,7 +2459,8 @@ boolean P_ZMovement(mobj_t *mo)
|
|||
;
|
||||
else if (mo->type == MT_PLAYER) // only DEAD players
|
||||
{
|
||||
mom.z = -4*mom.z/5;
|
||||
if (!P_CheckDeathPitFOFs(mo))
|
||||
mom.z = -4*mom.z/5;
|
||||
mo->flags |= MF_NOCLIPHEIGHT; // fall through floor next time
|
||||
}
|
||||
else if (mo->flags & MF_MISSILE)
|
||||
|
|
@ -3015,7 +3035,8 @@ boolean P_SceneryZMovement(mobj_t *mo)
|
|||
|
||||
if (mo->type == MT_KART_TIRE)
|
||||
{
|
||||
mo->momz = -mo->momz;
|
||||
if (!P_CheckDeathPitFOFs(mo))
|
||||
mo->momz = -mo->momz;
|
||||
mo->flags |= MF_NOCLIPHEIGHT;
|
||||
}
|
||||
else if (g_tm.floorthing)
|
||||
|
|
|
|||
|
|
@ -4611,19 +4611,19 @@ void P_SetupSignExit(player_t *player)
|
|||
}
|
||||
}
|
||||
|
||||
static boolean P_IsMobjTouchingPlane(mobj_t *mo, sector_t *sec, fixed_t floorz, fixed_t ceilingz)
|
||||
static boolean P_IsMobjTouchingPlane(const mobj_t *mo, const sector_t *sec, fixed_t floorz, fixed_t ceilingz)
|
||||
{
|
||||
boolean floorallowed = ((sec->flags & MSF_FLIPSPECIAL_FLOOR) && ((sec->flags & MSF_TRIGGERSPECIAL_HEADBUMP) || !(mo->eflags & MFE_VERTICALFLIP)) && (mo->z == floorz));
|
||||
boolean ceilingallowed = ((sec->flags & MSF_FLIPSPECIAL_CEILING) && ((sec->flags & MSF_TRIGGERSPECIAL_HEADBUMP) || (mo->eflags & MFE_VERTICALFLIP)) && (mo->z + mo->height == ceilingz));
|
||||
return (floorallowed || ceilingallowed);
|
||||
}
|
||||
|
||||
boolean P_IsMobjTouchingSectorPlane(mobj_t *mo, sector_t *sec)
|
||||
boolean P_IsMobjTouchingSectorPlane(const mobj_t *mo, const sector_t *sec)
|
||||
{
|
||||
return P_IsMobjTouchingPlane(mo, sec, P_GetSpecialBottomZ(mo, sec, sec), P_GetSpecialTopZ(mo, sec, sec));
|
||||
}
|
||||
|
||||
boolean P_IsMobjTouching3DFloor(mobj_t *mo, ffloor_t *fof, sector_t *sec)
|
||||
boolean P_IsMobjTouching3DFloor(const mobj_t *mo, const ffloor_t *fof, const sector_t *sec)
|
||||
{
|
||||
fixed_t topheight = P_GetSpecialTopZ(mo, sectors + fof->secnum, sec);
|
||||
fixed_t bottomheight = P_GetSpecialBottomZ(mo, sectors + fof->secnum, sec);
|
||||
|
|
@ -4641,7 +4641,7 @@ boolean P_IsMobjTouching3DFloor(mobj_t *mo, ffloor_t *fof, sector_t *sec)
|
|||
}
|
||||
}
|
||||
|
||||
boolean P_IsMobjTouchingPolyobj(mobj_t *mo, polyobj_t *po, sector_t *polysec)
|
||||
boolean P_IsMobjTouchingPolyobj(const mobj_t *mo, const polyobj_t *po, const sector_t *polysec)
|
||||
{
|
||||
if (!(po->flags & POF_TESTHEIGHT)) // Don't do height checking
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -627,9 +627,9 @@ boolean P_AllowFriction(mobj_t *mobj);
|
|||
|
||||
void P_SetupSignExit(player_t *player);
|
||||
|
||||
boolean P_IsMobjTouchingSectorPlane(mobj_t *mo, sector_t *sec);
|
||||
boolean P_IsMobjTouching3DFloor(mobj_t *mo, ffloor_t *ffloor, sector_t *sec);
|
||||
boolean P_IsMobjTouchingPolyobj(mobj_t *mo, polyobj_t *po, sector_t *polysec);
|
||||
boolean P_IsMobjTouchingSectorPlane(const mobj_t *mo, const sector_t *sec);
|
||||
boolean P_IsMobjTouching3DFloor(const mobj_t *mo, const ffloor_t *ffloor, const sector_t *sec);
|
||||
boolean P_IsMobjTouchingPolyobj(const mobj_t *mo, const polyobj_t *po, const sector_t *polysec);
|
||||
|
||||
void P_SwitchWeather(preciptype_t newWeather);
|
||||
|
||||
|
|
|
|||
|
|
@ -1455,7 +1455,7 @@ boolean P_PlayerHitFloor(player_t *player, boolean fromAir)
|
|||
|
||||
clipmomz = !(P_CheckDeathPitCollide(player->mo));
|
||||
|
||||
if (player->airtime > 10 && player->prevonground == false && fromAir == true && clipmomz == true)
|
||||
if (player->airtime > 10 && player->prevonground == false && fromAir == true && !P_CheckDeathPitFOFs(player->mo))
|
||||
{
|
||||
K_SpawnSplashForMobj(player->mo, abs(player->mo->momz));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue