- fixed usage of floor sound with Plat_DownWaitUpStayLip special

https://forum.zdoom.org/viewtopic.php?t=67126
This commit is contained in:
alexey.lysiuk 2020-01-31 13:21:14 +02:00
parent dd54c14380
commit c58e98cc7f
2 changed files with 10 additions and 4 deletions

View file

@ -86,6 +86,11 @@ void DPlat::PlayPlatSound (const char *sound)
}
}
const char *DPlat::GetSoundByType () const
{
return m_Type == platDownWaitUpStayStone ? "Floor" : "Platform";
}
//-----------------------------------------------------------------------------
//
// Move a plat up and down
@ -105,7 +110,7 @@ void DPlat::Tick ()
{
m_Count = m_Wait;
m_Status = down;
PlayPlatSound ("Platform");
PlayPlatSound (GetSoundByType ());
}
else if (res == EMoveResult::pastdest)
{
@ -176,7 +181,7 @@ void DPlat::Tick ()
{
m_Status = up;
m_Count = m_Wait;
PlayPlatSound ("Platform");
PlayPlatSound (GetSoundByType ());
}
//jff 1/26/98 remove the plat if it bounced so it can be tried again
@ -206,7 +211,7 @@ void DPlat::Tick ()
if (m_Type == platToggle)
SN_StartSequence (m_Sector, CHAN_FLOOR, "Silence", 0);
else
PlayPlatSound ("Platform");
PlayPlatSound (GetSoundByType ());
}
break;
@ -359,7 +364,7 @@ bool FLevelLocals::EV_DoPlat (int tag, line_t *line, DPlat::EPlatType type, doub
plat->m_High = sec->floorplane.fD();
plat->m_Status = DPlat::down;
plat->PlayPlatSound (type == DPlat::platDownWaitUpStay ? "Platform" : "Floor");
plat->PlayPlatSound (plat->GetSoundByType ());
break;
case DPlat::platUpNearestWaitDownStay:

View file

@ -52,6 +52,7 @@ protected:
EPlatType m_Type;
void PlayPlatSound (const char *sound);
const char *GetSoundByType () const;
void Reactivate ();
void Stop ();