- added a 'no MBF21' compatibility flag.

Turns out that there's a few old maps that have the extended line flags set but not the guard bit that forces their clearance.
Astrostein 1's first map is an example for this.
This commit is contained in:
Christoph Oelckers 2022-02-14 20:00:06 +01:00
commit c48de5d8d3
10 changed files with 263 additions and 249 deletions

View file

@ -588,7 +588,7 @@ CUSTOM_CVAR(Int, compatmode, 0, CVAR_ARCHIVE|CVAR_NOINITCALL)
v = COMPATF_SHORTTEX | COMPATF_STAIRINDEX | COMPATF_USEBLOCKING | COMPATF_NODOORLIGHT | COMPATF_SPRITESORT |
COMPATF_TRACE | COMPATF_MISSILECLIP | COMPATF_SOUNDTARGET | COMPATF_DEHHEALTH | COMPATF_CROSSDROPOFF |
COMPATF_LIGHT | COMPATF_MASKEDMIDTEX;
w = COMPATF2_FLOORMOVE | COMPATF2_EXPLODE1;
w = COMPATF2_FLOORMOVE | COMPATF2_EXPLODE1 | COMPATF2_NOMBF21;
break;
case 2: // same as 1 but stricter (NO_PASSMOBJ and INVISIBILITY are also set)
@ -596,36 +596,36 @@ CUSTOM_CVAR(Int, compatmode, 0, CVAR_ARCHIVE|CVAR_NOINITCALL)
COMPATF_TRACE | COMPATF_MISSILECLIP | COMPATF_SOUNDTARGET | COMPATF_NO_PASSMOBJ | COMPATF_LIMITPAIN |
COMPATF_DEHHEALTH | COMPATF_INVISIBILITY | COMPATF_CROSSDROPOFF | COMPATF_CORPSEGIBS | COMPATF_HITSCAN |
COMPATF_WALLRUN | COMPATF_NOTOSSDROPS | COMPATF_LIGHT | COMPATF_MASKEDMIDTEX;
w = COMPATF2_BADANGLES | COMPATF2_FLOORMOVE | COMPATF2_POINTONLINE | COMPATF2_EXPLODE2;
w = COMPATF2_BADANGLES | COMPATF2_FLOORMOVE | COMPATF2_POINTONLINE | COMPATF2_EXPLODE2 | COMPATF2_NOMBF21;
break;
case 3: // Boom compat mode
v = COMPATF_TRACE|COMPATF_SOUNDTARGET|COMPATF_BOOMSCROLL|COMPATF_MISSILECLIP|COMPATF_MASKEDMIDTEX;
w = COMPATF2_EXPLODE1;
w = COMPATF2_EXPLODE1 | COMPATF2_NOMBF21;
break;
case 4: // Old ZDoom compat mode
v = COMPATF_SOUNDTARGET | COMPATF_LIGHT;
w = COMPATF2_MULTIEXIT | COMPATF2_TELEPORT | COMPATF2_PUSHWINDOW | COMPATF2_CHECKSWITCHRANGE;
w = COMPATF2_MULTIEXIT | COMPATF2_TELEPORT | COMPATF2_PUSHWINDOW | COMPATF2_CHECKSWITCHRANGE | COMPATF2_NOMBF21;
break;
case 5: // MBF compat mode
v = COMPATF_TRACE | COMPATF_SOUNDTARGET | COMPATF_BOOMSCROLL | COMPATF_MISSILECLIP | COMPATF_MUSHROOM |
COMPATF_MBFMONSTERMOVE | COMPATF_NOBLOCKFRIENDS | COMPATF_MASKEDMIDTEX;
w = COMPATF2_EXPLODE1 | COMPATF2_AVOID_HAZARDS | COMPATF2_STAYONLIFT;
w = COMPATF2_EXPLODE1 | COMPATF2_AVOID_HAZARDS | COMPATF2_STAYONLIFT | COMPATF2_NOMBF21;
break;
case 6: // Boom with some added settings to reenable some 'broken' behavior
v = COMPATF_TRACE | COMPATF_SOUNDTARGET | COMPATF_BOOMSCROLL | COMPATF_MISSILECLIP | COMPATF_NO_PASSMOBJ |
COMPATF_INVISIBILITY | COMPATF_CORPSEGIBS | COMPATF_HITSCAN | COMPATF_WALLRUN | COMPATF_NOTOSSDROPS | COMPATF_MASKEDMIDTEX;
w = COMPATF2_POINTONLINE | COMPATF2_EXPLODE2;
w = COMPATF2_POINTONLINE | COMPATF2_EXPLODE2 | COMPATF2_NOMBF21;
break;
case 7: // Stricter MBF compatibility
v = COMPATF_CORPSEGIBS | COMPATF_NOBLOCKFRIENDS | COMPATF_MBFMONSTERMOVE | COMPATF_INVISIBILITY |
COMPATF_NOTOSSDROPS | COMPATF_MUSHROOM | COMPATF_NO_PASSMOBJ | COMPATF_BOOMSCROLL | COMPATF_WALLRUN |
COMPATF_TRACE | COMPATF_HITSCAN | COMPATF_MISSILECLIP | COMPATF_MASKEDMIDTEX | COMPATF_SOUNDTARGET;
w = COMPATF2_POINTONLINE | COMPATF2_EXPLODE1 | COMPATF2_EXPLODE2 | COMPATF2_AVOID_HAZARDS | COMPATF2_STAYONLIFT;
w = COMPATF2_POINTONLINE | COMPATF2_EXPLODE1 | COMPATF2_EXPLODE2 | COMPATF2_AVOID_HAZARDS | COMPATF2_STAYONLIFT | COMPATF2_NOMBF21;
break;
}
compatflags = v;
@ -677,6 +677,7 @@ CVAR (Flag, compat_explode2, compatflags2, COMPATF2_EXPLODE2);
CVAR (Flag, compat_railing, compatflags2, COMPATF2_RAILING);
CVAR (Flag, compat_avoidhazard, compatflags2, COMPATF2_AVOID_HAZARDS);
CVAR (Flag, compat_stayonlift, compatflags2, COMPATF2_STAYONLIFT);
CVAR (Flag, compat_nombf21, compatflags2, COMPATF2_NOMBF21);
CVAR(Bool, vid_activeinbackground, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)

View file

@ -224,6 +224,7 @@ enum : unsigned int
COMPATF2_SCRIPTWAIT = 1 << 11, // Use old scriptwait implementation where it doesn't wait on a non-running script.
COMPATF2_AVOID_HAZARDS = 1 << 12, // another MBF thing.
COMPATF2_STAYONLIFT = 1 << 13, // yet another MBF thing.
COMPATF2_NOMBF21 = 1 << 14, // disable MBF21 features that may clash with certain maps
};

View file

@ -597,6 +597,12 @@ public:
return p->camera == mo;
}
bool MBF21Enabled() const
{
// The affected features only are a problem with Doom format maps - the flag should have no effect in Hexen and UDMF format.
return !(i_compatflags2 & COMPATF2_NOMBF21) || maptype != MAPTYPE_DOOM;
}
int NumMapSections;
uint32_t flags;

View file

@ -1706,6 +1706,7 @@ MapFlagHandlers[] =
{ "compat_scriptwait", MITYPE_COMPATFLAG, 0, COMPATF2_SCRIPTWAIT },
{ "compat_avoidhazards", MITYPE_COMPATFLAG, 0, COMPATF2_AVOID_HAZARDS },
{ "compat_stayonlift", MITYPE_COMPATFLAG, 0, COMPATF2_STAYONLIFT },
{ "compat_nombf21", MITYPE_COMPATFLAG, 0, COMPATF2_NOMBF21 },
{ "cd_start_track", MITYPE_EATNEXT, 0, 0 },
{ "cd_end1_track", MITYPE_EATNEXT, 0, 0 },
{ "cd_end2_track", MITYPE_EATNEXT, 0, 0 },

View file

@ -169,6 +169,7 @@ static FCompatOption Options[] =
{ "explode2", COMPATF2_EXPLODE2, SLOT_COMPAT2 },
{ "railing", COMPATF2_RAILING, SLOT_COMPAT2 },
{ "scriptwait", COMPATF2_SCRIPTWAIT, SLOT_COMPAT2 },
{ "nombf21", COMPATF2_NOMBF21, SLOT_COMPAT2 },
{ NULL, 0, 0 }
};

View file

@ -484,11 +484,12 @@ void MapLoader::InitSectorSpecial(sector_t *sector, int special)
{
sector->Flags |= SECF_PUSH;
}
if (sector->special & KILL_MONSTERS_MASK)
// Nom MBF21 compatibility needs to be checked here, because after this point there is no longer any context in which it can be done.
if ((sector->special & KILL_MONSTERS_MASK) && Level->MBF21Enabled())
{
sector->Flags |= SECF_KILLMONSTERS;
}
if (!(sector->special & DEATH_MASK))
if (!(sector->special & DEATH_MASK) || !Level->MBF21Enabled())
{
if ((sector->special & DAMAGE_MASK) == 0x100)
{

View file

@ -197,11 +197,11 @@ inline bool P_IsBlockedByLine(AActor* actor, line_t* line)
// the regular 'blockmonsters' flag.
if (line->flags & ML_BLOCKMONSTERS) return true;
// MBF21's flag for walking monsters
if ((line->flags2 & ML2_BLOCKLANDMONSTERS) && !(actor->flags & MF_FLOAT)) return true;
if ((line->flags2 & ML2_BLOCKLANDMONSTERS) && actor->Level->MBF21Enabled() && !(actor->flags & MF_FLOAT)) return true;
}
// Blocking players
if (((actor->player != nullptr) || (actor->flags8 & MF8_BLOCKASPLAYER)) && (line->flags & ML_BLOCK_PLAYERS)) return true;
if ((((actor->player != nullptr) || (actor->flags8 & MF8_BLOCKASPLAYER)) && (line->flags & ML_BLOCK_PLAYERS)) && actor->Level->MBF21Enabled()) return true;
// Blocking floaters.
if ((actor->flags & MF_FLOAT) && (line->flags & ML_BLOCK_FLOATERS)) return true;