SE17 setup: when failing to find warp z height for lower level, use heuristic.

Specifically, use the elevator's own ceiling z height instead of searching
nextsectors with nextsectorneighborz().  This makes maps like L9.map (Spaceport
from N64) or DEMOUNT.MAP work.  [Note well: work at all, since if it happened
to work before, that was pure coincidence.]

git-svn-id: https://svn.eduke32.com/eduke32@3013 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-09-12 09:48:31 +00:00
parent 22a4eaaf3d
commit 91e8613ae4

View file

@ -5540,13 +5540,20 @@ int32_t A_Spawn(int32_t j, int32_t pn)
if (j >= 0)
{
T4 = sector[j].ceilingz;
}
else
{
// use elevator sector's ceiling as heuristic
T4 = sector[sect].ceilingz;
j = nextsectorneighborz(sect,sector[sect].ceilingz,1,1);
if (j >= 0)
T5 = sector[j].floorz;
OSD_Printf(OSD_ERROR "WARNING: SE17 sprite %d using own sector's ceilingz to "
"determine when to warp. Sector %d adjacent to a door?\n", i, sect);
}
if (j < 0)
j = nextsectorneighborz(sect,sector[sect].ceilingz,1,1);
if (j >= 0)
T5 = sector[j].floorz;
else
{
// XXX: we should return to the menu for this and similar failures
Bsprintf(tempbuf, "SE 17 (warp elevator) setup failed: sprite %d at (%d, %d)",