- Added another flag to P_FindFloorCeiling() to get it to do its standard processing but
without resetting the actor's sector. The 3D floor checks in P_NightmareRespawn() and A_RestoreSpecialPosition now use this. - Fixed: P_NightmareRespawn() did its Z clamping before checking for 3D floors. - Fixed: Respawning actors were not clamped to the ceiling. SVN r3542 (trunk)
This commit is contained in:
parent
c175acb75d
commit
d0bba7c3c3
7 changed files with 53 additions and 21 deletions
|
|
@ -170,12 +170,12 @@ static bool PIT_FindFloorCeiling (line_t *ld, const FBoundingBox &box, FCheckPos
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
void P_GetFloorCeilingZ(FCheckPosition &tmf, bool get)
|
||||
void P_GetFloorCeilingZ(FCheckPosition &tmf, int flags)
|
||||
{
|
||||
sector_t *sec;
|
||||
if (get)
|
||||
if (!(flags & FFCF_ONLYSPAWNPOS))
|
||||
{
|
||||
sec = P_PointInSector (tmf.x, tmf.y);
|
||||
sec = !(flags & FFCF_SAMESECTOR) ? P_PointInSector (tmf.x, tmf.y) : sec = tmf.thing->Sector;
|
||||
tmf.floorsector = sec;
|
||||
tmf.ceilingsector = sec;
|
||||
|
||||
|
|
@ -184,7 +184,10 @@ void P_GetFloorCeilingZ(FCheckPosition &tmf, bool get)
|
|||
tmf.floorpic = sec->GetTexture(sector_t::floor);
|
||||
tmf.ceilingpic = sec->GetTexture(sector_t::ceiling);
|
||||
}
|
||||
else sec = tmf.thing->Sector;
|
||||
else
|
||||
{
|
||||
sec = tmf.thing->Sector;
|
||||
}
|
||||
|
||||
#ifdef _3DFLOORS
|
||||
for(unsigned int i=0;i<sec->e->XFloor.ffloors.Size();i++)
|
||||
|
|
@ -219,7 +222,7 @@ void P_GetFloorCeilingZ(FCheckPosition &tmf, bool get)
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
void P_FindFloorCeiling (AActor *actor, bool onlyspawnpos)
|
||||
void P_FindFloorCeiling (AActor *actor, int flags)
|
||||
{
|
||||
FCheckPosition tmf;
|
||||
|
||||
|
|
@ -228,9 +231,9 @@ void P_FindFloorCeiling (AActor *actor, bool onlyspawnpos)
|
|||
tmf.y = actor->y;
|
||||
tmf.z = actor->z;
|
||||
|
||||
if (!onlyspawnpos)
|
||||
if (!(flags & FFCF_ONLYSPAWNPOS))
|
||||
{
|
||||
P_GetFloorCeilingZ(tmf, true);
|
||||
P_GetFloorCeilingZ(tmf, flags);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -240,7 +243,7 @@ void P_FindFloorCeiling (AActor *actor, bool onlyspawnpos)
|
|||
tmf.ceilingz = actor->ceilingz;
|
||||
tmf.floorpic = actor->floorpic;
|
||||
tmf.ceilingpic = actor->ceilingpic;
|
||||
P_GetFloorCeilingZ(tmf, false);
|
||||
P_GetFloorCeilingZ(tmf, flags);
|
||||
}
|
||||
actor->floorz = tmf.floorz;
|
||||
actor->dropoffz = tmf.dropoffz;
|
||||
|
|
@ -266,7 +269,7 @@ void P_FindFloorCeiling (AActor *actor, bool onlyspawnpos)
|
|||
|
||||
if (tmf.touchmidtex) tmf.dropoffz = tmf.floorz;
|
||||
|
||||
if (!onlyspawnpos || (tmf.abovemidtex && (tmf.floorz <= actor->z)))
|
||||
if (!(flags & FFCF_ONLYSPAWNPOS) || (tmf.abovemidtex && (tmf.floorz <= actor->z)))
|
||||
{
|
||||
actor->floorz = tmf.floorz;
|
||||
actor->dropoffz = tmf.dropoffz;
|
||||
|
|
@ -321,7 +324,7 @@ bool P_TeleportMove (AActor *thing, fixed_t x, fixed_t y, fixed_t z, bool telefr
|
|||
tmf.z = z;
|
||||
tmf.touchmidtex = false;
|
||||
tmf.abovemidtex = false;
|
||||
P_GetFloorCeilingZ(tmf, true);
|
||||
P_GetFloorCeilingZ(tmf, FFCF_ONLYSPAWNPOS);
|
||||
|
||||
spechit.Clear ();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue