This commit is contained in:
Charles 2001-07-12 20:53:17 +00:00
parent 2ba981f404
commit 349642025b
2 changed files with 29 additions and 0 deletions

View file

@ -20,6 +20,15 @@
#endif #endif
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcDropPlatform::postInit()
{
m_dropHit = false;
CNpcPlatform::postInit();
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcDropPlatform::processMovement( int _frames ) void CNpcDropPlatform::processMovement( int _frames )
@ -30,8 +39,24 @@ void CNpcDropPlatform::processMovement( int _frames )
if ( groundHeight < moveY ) 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; moveY = groundHeight;
} }
else
{
m_dropHit = false;
}
Pos.vy += moveY; Pos.vy += moveY;
} }

View file

@ -20,8 +20,12 @@
class CNpcDropPlatform : public CNpcPlatform class CNpcDropPlatform : public CNpcPlatform
{ {
public:
void postInit();
protected: protected:
void processMovement( int _frames ); void processMovement( int _frames );
u8 m_dropHit;
}; };
#endif #endif