- changed the means how to control the slowdown of crushing ceilings encountering an obstacle and corrected a few mistakes in the implementation

* there is a new crushing mode 3, which means that the crusher will always slow down if it hits an obstacle.
* crushing mode 1 (Doom mode) will never slow down.
* crushing mode 0 (compatibility) will only slow down for the specials that did so before, and only if both up and downspeed are 8 and the game is not Hexen. The following specials are affected:
  * Ceiling_LowerAndCrush
  * Ceiling_LowerAndCrushDist
  * Ceiling_CrushAndRaise
  * Ceiling_CrushAndRaiseA
  * Ceiling_CrushAndRaiseDist
  * Ceiling_CrushAndRaiseSilentA
  * Ceiling_CrushAndRaiseSilentDist
* Generic_Crusher was fixed to act like in Boom: Not only a speed value of 8 will cause slowdown, but all speed values up to 24.
* Hexen crushing mode will never cause slowdowns because Hexen never did this. (which also makes no real sense, considering that the crusher waits for the obstacle to die.)
This commit is contained in:
Christoph Oelckers 2016-03-25 02:08:22 +01:00
commit b70fee8ed8
3 changed files with 73 additions and 45 deletions

View file

@ -46,6 +46,14 @@ inline FArchive &operator<< (FArchive &arc, DCeiling::ECeiling &type)
return arc;
}
inline FArchive &operator<< (FArchive &arc, DCeiling::ECrushMode &type)
{
BYTE val = (BYTE)type;
arc << val;
type = (DCeiling::ECrushMode)val;
return arc;
}
//============================================================================
//
// CEILINGS
@ -80,7 +88,7 @@ void DCeiling::Serialize (FArchive &arc)
<< m_NewSpecial
<< m_Tag
<< m_OldDirection
<< m_Hexencrush;
<< m_CrushMode;
}
//============================================================================
@ -159,7 +167,7 @@ void DCeiling::Tick ()
case -1:
// DOWN
res = MoveCeiling (m_Speed, m_BottomHeight, m_Crush, m_Direction, m_Hexencrush);
res = MoveCeiling (m_Speed, m_BottomHeight, m_Crush, m_Direction, m_CrushMode == ECrushMode::crushHexen);
if (res == pastdest)
{
@ -196,7 +204,7 @@ void DCeiling::Tick ()
{
case ceilCrushAndRaise:
case ceilLowerAndCrush:
if (m_Speed1 == FRACUNIT && m_Speed2 == FRACUNIT)
if (m_CrushMode == ECrushMode::crushSlowdown)
m_Speed = FRACUNIT / 8;
break;
@ -224,7 +232,7 @@ DCeiling::DCeiling (sector_t *sec, fixed_t speed1, fixed_t speed2, int silent)
: DMovingCeiling (sec)
{
m_Crush = -1;
m_Hexencrush = false;
m_CrushMode = ECrushMode::crushDoom;
m_Speed = m_Speed1 = speed1;
m_Speed2 = speed2;
m_Silent = silent;
@ -238,7 +246,7 @@ DCeiling::DCeiling (sector_t *sec, fixed_t speed1, fixed_t speed2, int silent)
DCeiling *DCeiling::Create(sector_t *sec, DCeiling::ECeiling type, line_t *line, int tag,
fixed_t speed, fixed_t speed2, fixed_t height,
int crush, int silent, int change, bool hexencrush)
int crush, int silent, int change, ECrushMode hexencrush)
{
fixed_t targheight = 0; // Silence, GCC
@ -387,7 +395,7 @@ DCeiling *DCeiling::Create(sector_t *sec, DCeiling::ECeiling type, line_t *line,
ceiling->m_Tag = tag;
ceiling->m_Type = type;
ceiling->m_Crush = crush;
ceiling->m_Hexencrush = hexencrush;
ceiling->m_CrushMode = hexencrush;
// Do not interpolate instant movement ceilings.
// Note for ZDoomGL: Check to make sure that you update the sector
@ -476,7 +484,7 @@ DCeiling *DCeiling::Create(sector_t *sec, DCeiling::ECeiling type, line_t *line,
bool EV_DoCeiling (DCeiling::ECeiling type, line_t *line,
int tag, fixed_t speed, fixed_t speed2, fixed_t height,
int crush, int silent, int change, bool hexencrush)
int crush, int silent, int change, DCeiling::ECrushMode hexencrush)
{
int secnum;
bool rtn;