diff --git a/src/gamedata/g_mapinfo.cpp b/src/gamedata/g_mapinfo.cpp index 41e3c14ff..8c075f51c 100644 --- a/src/gamedata/g_mapinfo.cpp +++ b/src/gamedata/g_mapinfo.cpp @@ -1644,6 +1644,7 @@ MapFlagHandlers[] = { "nolightfade", MITYPE_SETFLAG3, LEVEL3_NOLIGHTFADE, 0 }, { "nocoloredspritelighting", MITYPE_SETFLAG3, LEVEL3_NOCOLOREDSPRITELIGHTING, 0 }, { "forceworldpanning", MITYPE_SETFLAG3, LEVEL3_FORCEWORLDPANNING, 0 }, + { "propermonsterfallingdamage", MITYPE_SETFLAG3, LEVEL3_PROPERMONSTERFALLINGDAMAGE, 0 }, { "nobotnodes", MITYPE_IGNORE, 0, 0 }, // Skulltag option: nobotnodes { "compat_shorttex", MITYPE_COMPATFLAG, COMPATF_SHORTTEX, 0 }, { "compat_stairs", MITYPE_COMPATFLAG, COMPATF_STAIRINDEX, 0 }, diff --git a/src/gamedata/g_mapinfo.h b/src/gamedata/g_mapinfo.h index 79953e88a..30e85bd39 100644 --- a/src/gamedata/g_mapinfo.h +++ b/src/gamedata/g_mapinfo.h @@ -249,6 +249,7 @@ enum ELevelFlags : unsigned int LEVEL3_EXITSECRETUSED = 0x00000040, LEVEL3_FORCEWORLDPANNING = 0x00000080, // Forces the world panning flag for all textures, even those without it explicitly set. LEVEL3_HIDEAUTHORNAME = 0x00000100, + LEVEL3_PROPERMONSTERFALLINGDAMAGE = 0x00000200, // Properly apply falling damage to the monsters }; diff --git a/src/playsim/actor.h b/src/playsim/actor.h index f5d3d14bb..063eead84 100644 --- a/src/playsim/actor.h +++ b/src/playsim/actor.h @@ -413,6 +413,8 @@ enum ActorFlag8 MF8_RECREATELIGHTS = 0x00000100, // Internal flag that signifies that the light attachments need to be recreated at the MF8_STOPRAILS = 0x00000200, // [MC] Prevent rails from going further if an actor has this flag. MF8_ABSVIEWANGLES = 0x00000400, // [MC] By default view angle/pitch/roll is an offset. This will make it absolute instead. + MF8_FALLDAMAGE = 0x00000800, // Monster will take fall damage regardless of map settings. + }; // --- mobj.renderflags --- diff --git a/src/playsim/p_mobj.cpp b/src/playsim/p_mobj.cpp index 5bd391d64..6cc6f670e 100644 --- a/src/playsim/p_mobj.cpp +++ b/src/playsim/p_mobj.cpp @@ -2345,7 +2345,7 @@ void P_MonsterFallingDamage (AActor *mo) int damage; double vel; - if (!(mo->Level->flags2 & LEVEL2_MONSTERFALLINGDAMAGE)) + if (!(mo->Level->flags2 & LEVEL2_MONSTERFALLINGDAMAGE) && !(mo->flags8 & MF8_FALLDAMAGE)) return; if (mo->floorsector->Flags & SECF_NOFALLINGDAMAGE) return; @@ -2359,7 +2359,7 @@ void P_MonsterFallingDamage (AActor *mo) { damage = int((vel - 23)*6); } - damage = TELEFRAG_DAMAGE; // always kill 'em + if (!(mo->Level->flags3 & LEVEL3_PROPERMONSTERFALLINGDAMAGE)) damage = TELEFRAG_DAMAGE; P_DamageMobj (mo, NULL, NULL, damage, NAME_Falling); } diff --git a/src/scripting/thingdef_data.cpp b/src/scripting/thingdef_data.cpp index 571efff64..fb32e4f8b 100644 --- a/src/scripting/thingdef_data.cpp +++ b/src/scripting/thingdef_data.cpp @@ -325,6 +325,7 @@ static FFlagDef ActorFlagDefs[]= DEFINE_FLAG(MF8, NOFRICTIONBOUNCE, AActor, flags8), DEFINE_FLAG(MF8, RETARGETAFTERSLAM, AActor, flags8), DEFINE_FLAG(MF8, STOPRAILS, AActor, flags8), + DEFINE_FLAG(MF8, FALLDAMAGE, AActor, flags8), DEFINE_FLAG(MF8, ABSVIEWANGLES, AActor, flags8), // Effect flags