- 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:
Randy Heit 2012-04-08 05:39:46 +00:00
commit d0bba7c3c3
7 changed files with 53 additions and 21 deletions

View file

@ -2476,12 +2476,34 @@ void P_NightmareRespawn (AActor *mobj)
// can use P_CheckPosition() properly.
mo->z = mo->floorz;
}
if (mo->z + mo->height > mo->ceilingz)
{
mo->z = mo->ceilingz - mo->height;
}
}
else if (z == ONCEILINGZ)
{
mo->z -= mobj->SpawnPoint[2];
}
// If there are 3D floors, we need to find floor/ceiling again.
P_FindFloorCeiling(mo, FFCF_SAMESECTOR);
if (z == ONFLOORZ)
{
if (mo->z < mo->floorz)
{ // Do not respawn monsters in the floor, even if that's where they
// started. The initial P_ZMovement() call would have put them on
// the floor right away, but we need them on the floor now so we
// can use P_CheckPosition() properly.
mo->z = mo->floorz;
}
if (mo->z + mo->height > mo->ceilingz)
{ // Do the same for the ceiling.
mo->z = mo->ceilingz - mo->height;
}
}
// something is occupying its position?
if (!P_CheckPosition(mo, mo->x, mo->y, true))
{
@ -2491,9 +2513,6 @@ void P_NightmareRespawn (AActor *mobj)
return; // no respawn
}
// If there are 3D floors, we need to find floor/ceiling again.
P_FindFloorCeiling(mo, true);
z = mo->z;
// inherit attributes from deceased one
@ -3629,7 +3648,7 @@ AActor *AActor::StaticSpawn (const PClass *type, fixed_t ix, fixed_t iy, fixed_t
// z-coordinate.
if (!SpawningMapThing)
{
P_FindFloorCeiling(actor, true);
P_FindFloorCeiling(actor, FFCF_ONLYSPAWNPOS);
}
else
{
@ -4495,7 +4514,7 @@ AActor *P_SpawnMapThing (FMapThing *mthing, int position)
mobj->SpawnPoint[2] = mthing->z;
mobj->SpawnAngle = mthing->angle;
mobj->SpawnFlags = mthing->flags;
P_FindFloorCeiling(mobj, true);
P_FindFloorCeiling(mobj, FFCF_ONLYSPAWNPOS);
if (!(mobj->flags2 & MF2_ARGSDEFINED))
{