From 7c2fc08f3564c6448260594912a2c3b45f9f4cf1 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sun, 4 Feb 2007 02:12:54 +0000 Subject: [PATCH] - Added two new MAPINFO flags to control what actor activates impact lines: * MissileShootersActivateImpactLines - the current behavior. * MissilesActivateImpactLines - the original Hexen behavior. SVN r477 (trunk) --- docs/rh-log.txt | 3 +++ src/g_level.cpp | 14 ++++++++++---- src/g_level.h | 4 +++- src/p_map.cpp | 12 ++++++++++-- 4 files changed, 26 insertions(+), 7 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 8580b0a51..ce7630b58 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,7 @@ February 3, 2007 +- Added two new MAPINFO flags to control what actor activates impact lines: + * MissileShootersActivateImpactLines - the current behavior. + * MissilesActivateImpactLines - the original Hexen behavior. - Fixed: The changecamera special should remove "past viewer" information from the renderer in case the camera changed position or direction since the last time it was looked through. Otherwise, the renderer will diff --git a/src/g_level.cpp b/src/g_level.cpp index a1f00d185..8ded9730d 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -242,6 +242,8 @@ static const char *MapInfoMapLevel[] = "filterstarts", "activateowndeathspecials", "killeractivatesdeathspecials", + "missilesactivateimpactlines", + "missileshootersactivetimpactlines", "noinventorybar", "deathslideshow", "redirect", @@ -373,6 +375,8 @@ MapHandlers[] = { MITYPE_SETFLAG, LEVEL_FILTERSTARTS, 0 }, { MITYPE_SETFLAG, LEVEL_ACTOWNSPECIAL, 0 }, { MITYPE_CLRFLAG, LEVEL_ACTOWNSPECIAL, 0 }, + { MITYPE_SETFLAG, LEVEL_MISSILESACTIVATEIMPACT, 0 }, + { MITYPE_CLRFLAG, LEVEL_MISSILESACTIVATEIMPACT, 0 }, { MITYPE_SETFLAG, LEVEL_NOINVENTORYBAR, 0 }, { MITYPE_SETFLAG, LEVEL_DEATHSLIDESHOW, 0 }, { MITYPE_REDIRECT, lioffset(RedirectMap), 0 }, @@ -562,7 +566,7 @@ static void G_DoParseMapInfo (int lump) SetLevelDefaults (&defaultinfo); SC_OpenLumpNum (lump, "MAPINFO"); - HexenHack=false; + HexenHack = false; while (SC_GetString ()) { @@ -584,12 +588,14 @@ static void G_DoParseMapInfo (int lump) sprintf (sc_String, "MAP%02d", map); HexenHack = true; // Hexen levels are automatically nointermission, - // no auto sound sequences, falling damage, and - // monsters activate their own specials. + // no auto sound sequences, falling damage, + // monsters activate their own specials, and missiles + // are always the activators of impact lines. levelflags |= LEVEL_NOINTERMISSION | LEVEL_SNDSEQTOTALCTRL | LEVEL_FALLDMG_HX - | LEVEL_ACTOWNSPECIAL; + | LEVEL_ACTOWNSPECIAL + | LEVEL_MISSILESACTIVATEIMPACT; } levelindex = FindWadLevelInfo (sc_String); if (levelindex == -1) diff --git a/src/g_level.h b/src/g_level.h index 80c8384fe..ec5f73a7e 100644 --- a/src/g_level.h +++ b/src/g_level.h @@ -92,7 +92,9 @@ #define LEVEL_LAXMONSTERACTIVATION UCONST64(0x400000000) // Monsters can open doors depending on the door speed #define LEVEL_LAXACTIVATIONMAPINFO UCONST64(0x800000000) // LEVEL_LAXMONSTERACTIVATION is not a default. -// some unused bits here! + +#define LEVEL_MISSILESACTIVATEIMPACT UCONST64(0x1000000000) // Missiles are the activators of SPAC_IMPACT events, not their shooters +// an unused bit here! #define LEVEL_KEEPFULLINVENTORY UCONST64(0x4000000000) // doesn't reduce the amount of inventory items to 1 diff --git a/src/p_map.cpp b/src/p_map.cpp index 9a7c1beb7..e251d87c6 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -1539,8 +1539,16 @@ static void CheckForPushSpecial (line_t *line, int side, AActor *mobj) } else if (mobj->flags2 & MF2_IMPACT) { - P_ActivateLine (line, ((mobj->flags & MF_MISSILE) && (mobj->target != NULL)) - ? mobj->target : mobj, side, SPAC_IMPACT); + if ((level.flags & LEVEL_MISSILESACTIVATEIMPACT) || + !(mobj->flags & MF_MISSILE) || + (mobj->target == NULL)) + { + P_ActivateLine (line, mobj, side, SPAC_IMPACT); + } + else + { + P_ActivateLine (line, mobj->target, side, SPAC_IMPACT); + } } } }