From 709414e6066c4e3512de9d0fa40089a1db9cfb13 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Tue, 25 May 2010 03:40:37 +0000 Subject: [PATCH] - Fixed: Animated doors should only leave ML_BLOCKING set if the door was created with it set. Otherwise, monsters will be unable to open it after it has been used once if it isn't set for push activation. SVN r2336 (trunk) --- src/doomdata.h | 2 +- src/p_doors.cpp | 21 +++++++++++++++++++++ src/p_map.cpp | 19 ++++++++++--------- src/p_spec.h | 1 + 4 files changed, 33 insertions(+), 10 deletions(-) diff --git a/src/doomdata.h b/src/doomdata.h index 028ae5512..859246261 100644 --- a/src/doomdata.h +++ b/src/doomdata.h @@ -139,7 +139,7 @@ enum ELineFlags ML_ADDTRANS = 0x00000400, // additive translucency (can only be set internally) // Extended flags - ML_MONSTERSCANACTIVATE = 0x00002000, // [RH] Monsters (as well as players) can active the line + ML_MONSTERSCANACTIVATE = 0x00002000, // [RH] Monsters (as well as players) can activate the line ML_BLOCK_PLAYERS = 0x00004000, ML_BLOCKEVERYTHING = 0x00008000, // [RH] Line blocks everything ML_ZONEBOUNDARY = 0x00010000, diff --git a/src/p_doors.cpp b/src/p_doors.cpp index 29ec1fc6b..ccfd61c5d 100644 --- a/src/p_doors.cpp +++ b/src/p_doors.cpp @@ -626,6 +626,17 @@ void DAnimatedDoor::Tick () MoveCeiling (2048*FRACUNIT, m_BotDist, -1); m_Sector->ceilingdata = NULL; Destroy (); + // Unset blocking flags on lines that didn't start with them. Since the + // ceiling is down now, we shouldn't need this flag anymore to keep things + // from getting through. + if (!m_SetBlocking1) + { + m_Line1->flags &= ~ML_BLOCKING; + } + if (!m_SetBlocking2) + { + m_Line2->flags &= ~ML_BLOCKING; + } break; } else @@ -668,6 +679,14 @@ void DAnimatedDoor::Serialize (FArchive &arc) << m_Speed << m_Delay << basetex; + if (SaveVersion < 2336) + { + m_SetBlocking1 = m_SetBlocking2 = true; + } + else + { + arc << m_SetBlocking1 << m_SetBlocking2; + } if (arc.IsLoading()) { @@ -727,6 +746,8 @@ DAnimatedDoor::DAnimatedDoor (sector_t *sec, line_t *line, int speed, int delay) m_Delay = delay; m_Timer = m_Speed; m_Frame = 0; + m_SetBlocking1 = !!(m_Line1->flags & ML_BLOCKING); + m_SetBlocking2 = !!(m_Line2->flags & ML_BLOCKING); m_Line1->flags |= ML_BLOCKING; m_Line2->flags |= ML_BLOCKING; m_BotDist = m_Sector->ceilingplane.d; diff --git a/src/p_map.cpp b/src/p_map.cpp index 9ff863e2b..09d1f944a 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -620,16 +620,17 @@ bool PIT_CheckLine (line_t *ld, const FBoundingBox &box, FCheckPosition &tm) return false; } - // MBF bouncers are treated as missiles here. - bool Projectile = (tm.thing->flags & MF_MISSILE || tm.thing->BounceFlags & BOUNCE_MBF); - // MBF considers that friendly monsters are not blocked by monster-blocking lines. - // This is added here as a compatibility option. Note that monsters that are dehacked - // into being friendly with the MBF flag automatically gain MF3_NOBLOCKMONST, so this - // just optionally generalizes the behavior to other friendly monsters. - bool NotBlocked = ((tm.thing->flags3 & MF3_NOBLOCKMONST) - || ((i_compatflags & COMPATF_NOBLOCKFRIENDS) && (tm.thing->flags & MF_FRIENDLY))); + // MBF bouncers are treated as missiles here. + bool Projectile = (tm.thing->flags & MF_MISSILE || tm.thing->BounceFlags & BOUNCE_MBF); + // MBF considers that friendly monsters are not blocked by monster-blocking lines. + // This is added here as a compatibility option. Note that monsters that are dehacked + // into being friendly with the MBF flag automatically gain MF3_NOBLOCKMONST, so this + // just optionally generalizes the behavior to other friendly monsters. + bool NotBlocked = ((tm.thing->flags3 & MF3_NOBLOCKMONST) + || ((i_compatflags & COMPATF_NOBLOCKFRIENDS) && (tm.thing->flags & MF_FRIENDLY))); - if (!(Projectile) || (ld->flags & (ML_BLOCKEVERYTHING|ML_BLOCKPROJECTILE))) { + if (!(Projectile) || (ld->flags & (ML_BLOCKEVERYTHING|ML_BLOCKPROJECTILE))) + { if (ld->flags & ML_RAILING) { rail = true; diff --git a/src/p_spec.h b/src/p_spec.h index ca0d9492c..ca3694c09 100644 --- a/src/p_spec.h +++ b/src/p_spec.h @@ -640,6 +640,7 @@ protected: }; int m_Speed; int m_Delay; + bool m_SetBlocking1, m_SetBlocking2; friend bool EV_SlidingDoor (line_t *line, AActor *thing, int tag, int speed, int delay); private: