diff --git a/src/compatibility.cpp b/src/compatibility.cpp index 880f887899..bfd5ae3257 100644 --- a/src/compatibility.cpp +++ b/src/compatibility.cpp @@ -90,6 +90,7 @@ static FCompatOption Options[] = { "resetplayerspeed", 0, BCOMPATF_RESETPLAYERSPEED }, { "vileghosts", 0, BCOMPATF_VILEGHOSTS }, { "ignoreteleporttags", 0, BCOMPATF_BADTELEPORTERS }, + { "oldportals", 0, BCOMPATF_BADPORTALS }, // list copied from g_mapinfo.cpp { "shorttex", COMPATF_SHORTTEX, 0 }, @@ -280,7 +281,12 @@ void CheckCompatibility(MapData *map) ib_compatflags = 0; ii_compatparams = -1; } - + else if (Wads.GetLumpFile(map->lumpnum) == 1 && (gameinfo.flags & GI_COMPATPORTAL)) + { + ii_compatflags = 0; + ib_compatflags = BCOMPATF_BADPORTALS; + ii_compatparams = -1; + } else { map->GetChecksum(md5.Bytes); diff --git a/src/d_iwad.cpp b/src/d_iwad.cpp index 6fd42a6292..123f33f7d4 100644 --- a/src/d_iwad.cpp +++ b/src/d_iwad.cpp @@ -174,6 +174,7 @@ void FIWadManager::ParseIWadInfo(const char *fn, const char *data, int datasize) else if(sc.Compare("Extended")) iwad->flags |= GI_MENUHACK_EXTENDED; else if(sc.Compare("Shorttex")) iwad->flags |= GI_COMPATSHORTTEX; else if(sc.Compare("Stairs")) iwad->flags |= GI_COMPATSTAIRS; + else if(sc.Compare("Portals")) iwad->flags |= GI_BADPORTALS; else sc.ScriptError(NULL); } while (sc.CheckString(",")); diff --git a/src/doomdef.h b/src/doomdef.h index cad56d642c..748f2df4a9 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -342,6 +342,7 @@ enum BCOMPATF_RESETPLAYERSPEED = 1 << 1, // Set player speed to 1.0 when changing maps BCOMPATF_VILEGHOSTS = 1 << 2, // Monsters' radius and height aren't restored properly when resurrected. BCOMPATF_BADTELEPORTERS = 1 << 3, // Ignore tags on Teleport specials + BCOMPATF_BADPORTALS = 1 << 4, // Restores the old unstable portal behavior }; // phares 3/20/98: diff --git a/src/p_spec.cpp b/src/p_spec.cpp index eeb58d0c36..a2e09d347b 100644 --- a/src/p_spec.cpp +++ b/src/p_spec.cpp @@ -975,6 +975,9 @@ void P_SetupPortals() points.Push(pt); } + // Maps using undefined portal hacks may not benefit from portal optimizations. + if (ib_compatflags & BCOMPATF_BADPORTALS) return; + for(unsigned i=0;ispecial1 == 0 && points[i]->Mate != NULL) diff --git a/src/r_plane.cpp b/src/r_plane.cpp index eaa3d4b471..3fa6bdf73f 100644 --- a/src/r_plane.cpp +++ b/src/r_plane.cpp @@ -582,20 +582,27 @@ visplane_t *R_FindPlane (const secplane_t &height, FTextureID picnum, int lightl check->viewx == stacked_viewx && check->viewy == stacked_viewy && check->viewz == stacked_viewz && - check->alpha == alpha && - (alpha == 0 || // if alpha is > 0 everything needs to be checked - (plane == check->height && - picnum == check->picnum && - lightlevel == check->lightlevel && - xoffs == check->xoffs && // killough 2/28/98: Add offset checks - yoffs == check->yoffs && - basecolormap == check->colormap && // [RH] Add more checks - xscale == check->xscale && - yscale == check->yscale && - angle == check->angle + ( + // headache inducing logic... :( + (ib_compatflags & BCOMPATF_BADPORTALS) || + ( + check->alpha == alpha && + (alpha == 0 || // if alpha is > 0 everything needs to be checked + (plane == check->height && + picnum == check->picnum && + lightlevel == check->lightlevel && + xoffs == check->xoffs && // killough 2/28/98: Add offset checks + yoffs == check->yoffs && + basecolormap == check->colormap && // [RH] Add more checks + xscale == check->xscale && + yscale == check->yscale && + angle == check->angle + ) + ) && + check->viewangle == stacked_angle ) - ) && - check->viewangle == stacked_angle) + ) + ) { return check; } diff --git a/wadsrc/static/iwadinfo.txt b/wadsrc/static/iwadinfo.txt index efdf836a59..7a94f244ad 100644 --- a/wadsrc/static/iwadinfo.txt +++ b/wadsrc/static/iwadinfo.txt @@ -26,6 +26,7 @@ IWad Game = "Doom" Config = "UrbanBrawl" Mapinfo = "mapinfo/urbanbrawl.txt" + Compatibility = "Portals" MustContain = "MAP01", "AD2LIB" BannerColors = "a8 a8 00", "a8 00 00" }