diff --git a/source/platform/pbubtube.cpp b/source/platform/pbubtube.cpp index 65e39cca9..213ba8450 100644 --- a/source/platform/pbubtube.cpp +++ b/source/platform/pbubtube.cpp @@ -114,9 +114,21 @@ void CNpcBubbleTubePlatform::processMovement( int _frames ) if ( extension ) { m_extension += extension; + + if(m_soundId==NOT_PLAYING) + { + m_soundId=CSoundMediator::playSfx(CSoundMediator::SFX_ELEVATOR_LOOP,true,true); + } } else { + if ( m_soundId != NOT_PLAYING ) + { + CSoundMediator::stopAndUnlockSfx( (xmPlayingId) m_soundId ); + } + + m_soundId=CSoundMediator::playSfx(CSoundMediator::SFX_ELEVATOR_STOP,true,true); + if ( m_returning ) { m_isActivated = false; diff --git a/source/platform/pjellfsh.cpp b/source/platform/pjellfsh.cpp index bd0bfa2d1..49a46b3d2 100644 --- a/source/platform/pjellfsh.cpp +++ b/source/platform/pjellfsh.cpp @@ -51,6 +51,7 @@ void CNpcJellyfishPlatform::postInit() m_dipCount = 0; m_dipOffset = 0; m_contactTimeout = 0; + m_silent = true; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/platform/plift.cpp b/source/platform/plift.cpp index 42a866073..cf646e998 100644 --- a/source/platform/plift.cpp +++ b/source/platform/plift.cpp @@ -126,9 +126,21 @@ void CNpcLiftPlatform::processMovement( int _frames ) if ( extension ) { m_extension += extension; + + if(m_soundId==NOT_PLAYING) + { + m_soundId=CSoundMediator::playSfx(CSoundMediator::SFX_ELEVATOR_LOOP,true,true); + } } else { + if ( m_soundId != NOT_PLAYING ) + { + CSoundMediator::stopAndUnlockSfx( (xmPlayingId) m_soundId ); + } + + m_soundId=CSoundMediator::playSfx(CSoundMediator::SFX_ELEVATOR_STOP,true,true); + if ( m_returning ) { m_isActivated = false; diff --git a/source/platform/plinear.cpp b/source/platform/plinear.cpp index 0c2d933c0..678c8e4a1 100644 --- a/source/platform/plinear.cpp +++ b/source/platform/plinear.cpp @@ -22,6 +22,8 @@ void CNpcLinearPlatform::postInit() CNpcPlatform::postInit(); m_npcPath.setPathType( CNpcPath::PONG_PATH ); + + m_silent = false; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -35,6 +37,14 @@ void CNpcLinearPlatform::processMovement( int _frames ) bool pathComplete; bool waypointChange; + if ( !m_silent ) + { + if(m_soundId==NOT_PLAYING) + { + m_soundId=CSoundMediator::playSfx(CSoundMediator::SFX_ELEVATOR_LOOP,true,true); + } + } + s16 headingToTarget = m_npcPath.think( Pos, &pathComplete, &waypointChange, &xDist, &yDist ); if ( !pathComplete ) diff --git a/source/platform/plinear.h b/source/platform/plinear.h index 8dda3ef7a..f334785a1 100644 --- a/source/platform/plinear.h +++ b/source/platform/plinear.h @@ -24,6 +24,8 @@ public: virtual void postInit(); protected: void processMovement( int _frames ); + + u8 m_silent; }; #endif \ No newline at end of file