From 349642025b05948bf3ae1a3ecf94ce980a85a141 Mon Sep 17 00:00:00 2001 From: Charles Date: Thu, 12 Jul 2001 20:53:17 +0000 Subject: [PATCH] --- source/platform/pdrop.cpp | 25 +++++++++++++++++++++++++ source/platform/pdrop.h | 4 ++++ 2 files changed, 29 insertions(+) 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