diff --git a/source/platform/pdrop.cpp b/source/platform/pdrop.cpp index d93c28d56..4c32d8d6f 100644 --- a/source/platform/pdrop.cpp +++ b/source/platform/pdrop.cpp @@ -20,6 +20,15 @@ #endif +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void CNpcDropPlatform::postInit() +{ + m_dropHit = false; + + CNpcPlatform::postInit(); +} + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// void CNpcDropPlatform::processMovement( int _frames ) @@ -30,8 +39,24 @@ void CNpcDropPlatform::processMovement( int _frames ) if ( groundHeight < moveY ) { + if ( !m_dropHit ) + { + if( m_soundId != NOT_PLAYING ) + { + CSoundMediator::stopAndUnlockSfx( (xmPlayingId) m_soundId ); + } + + m_soundId = (int) CSoundMediator::playSfx( CSoundMediator::SFX_HAZARD__FALLING_ROCK_LAND, true ); + } + + m_dropHit = true; + moveY = groundHeight; } + else + { + m_dropHit = false; + } Pos.vy += moveY; } diff --git a/source/platform/pdrop.h b/source/platform/pdrop.h index 3c6d73e1a..3f2b57e86 100644 --- a/source/platform/pdrop.h +++ b/source/platform/pdrop.h @@ -20,8 +20,12 @@ class CNpcDropPlatform : public CNpcPlatform { +public: + void postInit(); protected: void processMovement( int _frames ); + + u8 m_dropHit; }; #endif \ No newline at end of file