From c58e98cc7f163f29a18cc89f02598bb04250a407 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Fri, 31 Jan 2020 13:21:14 +0200 Subject: [PATCH] - fixed usage of floor sound with Plat_DownWaitUpStayLip special https://forum.zdoom.org/viewtopic.php?t=67126 --- src/playsim/mapthinkers/a_plats.cpp | 13 +++++++++---- src/playsim/mapthinkers/a_plats.h | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/playsim/mapthinkers/a_plats.cpp b/src/playsim/mapthinkers/a_plats.cpp index 4cc4367ab..8decb188f 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 947f104cf..fd8d4e975 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 ();