diff --git a/src/playsim/mapthinkers/a_plats.cpp b/src/playsim/mapthinkers/a_plats.cpp index 4cc4367ab9..8decb188fe 100644 --- a/src/playsim/mapthinkers/a_plats.cpp +++ b/src/playsim/mapthinkers/a_plats.cpp @@ -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: diff --git a/src/playsim/mapthinkers/a_plats.h b/src/playsim/mapthinkers/a_plats.h index 947f104cfb..fd8d4e975f 100644 --- a/src/playsim/mapthinkers/a_plats.h +++ b/src/playsim/mapthinkers/a_plats.h @@ -52,6 +52,7 @@ protected: EPlatType m_Type; void PlayPlatSound (const char *sound); + const char *GetSoundByType () const; void Reactivate (); void Stop ();