diff --git a/src/doomdef.h b/src/doomdef.h index 811b4fa5e..f1f4f352e 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -242,6 +242,7 @@ enum : unsigned int COMPATF2_NOMBF21 = 1 << 14, // disable MBF21 features that may clash with certain maps COMPATF2_VOODOO_ZOMBIES = 1 << 15, // [RL0] allow playerinfo, playerpawn, and voodoo health to all be different, and skip killing the player's mobj if a voodoo doll dies to allow voodoo zombies COMPATF2_FDTELEPORT = 1 << 16, // Emulate Final Doom's teleporter z glitch. + COMPATF2_NOACSARGCHECK = 1 << 17, // Disable arg count checking for ACS }; diff --git a/src/gamedata/g_mapinfo.cpp b/src/gamedata/g_mapinfo.cpp index 0e6a5fe6f..748d7cacd 100644 --- a/src/gamedata/g_mapinfo.cpp +++ b/src/gamedata/g_mapinfo.cpp @@ -1867,6 +1867,7 @@ MapFlagHandlers[] = { "compat_stayonlift", MITYPE_COMPATFLAG, 0, COMPATF2_STAYONLIFT }, { "compat_nombf21", MITYPE_COMPATFLAG, 0, COMPATF2_NOMBF21 }, { "compat_voodoozombies", MITYPE_COMPATFLAG, 0, COMPATF2_VOODOO_ZOMBIES }, + { "compat_noacsargcheck", MITYPE_COMPATFLAG, 0, COMPATF2_NOACSARGCHECK }, { "cd_start_track", MITYPE_EATNEXT, 0, 0 }, { "cd_end1_track", MITYPE_EATNEXT, 0, 0 }, { "cd_end2_track", MITYPE_EATNEXT, 0, 0 }, diff --git a/src/maploader/compatibility.cpp b/src/maploader/compatibility.cpp index 7caddc90a..1ba18d444 100644 --- a/src/maploader/compatibility.cpp +++ b/src/maploader/compatibility.cpp @@ -174,6 +174,7 @@ static FCompatOption Options[] = { "nombf21", COMPATF2_NOMBF21, SLOT_COMPAT2 }, { "voodoozombies", COMPATF2_VOODOO_ZOMBIES, SLOT_COMPAT2 }, { "fdteleport", COMPATF2_FDTELEPORT, SLOT_COMPAT2 }, + { "noacsargcheck", COMPATF2_NOACSARGCHECK, SLOT_COMPAT2 }, { NULL, 0, 0 } }; diff --git a/src/playsim/p_acs.cpp b/src/playsim/p_acs.cpp index b464ed2a5..1d4e90d1e 100644 --- a/src/playsim/p_acs.cpp +++ b/src/playsim/p_acs.cpp @@ -5323,7 +5323,13 @@ int DLevelScript::SwapActorTeleFog(AActor *activator, int tid) } // Macro for CallFunction. Checks passed number of arguments with minimum required. Sets needCount and returns if not enough. -#define MIN_ARG_COUNT(minCount) do { if (argCount < minCount) { needCount = minCount; return 0; } } while(0) +#define MIN_ARG_COUNT(minCount) \ + do { \ + if (argCount < minCount && !(Level->i_compatflags2 & COMPATF2_NOACSARGCHECK)) { \ + needCount = minCount; \ + return 0; \ + } \ + } while(0) int DLevelScript::CallFunction(int argCount, int funcIndex, int32_t *args, int &needCount) {