From 91e8613ae4c14d578f5fdf0f79fd80bda2e3446c Mon Sep 17 00:00:00 2001 From: helixhorned Date: Wed, 12 Sep 2012 09:48:31 +0000 Subject: [PATCH] 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 --- polymer/eduke32/source/game.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 4ecbb20a5..56ec058b5 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -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)",