From a84e8bbf513e7bf4e2f846dc366e056a87584f42 Mon Sep 17 00:00:00 2001 From: Charles Date: Tue, 31 Jul 2001 18:52:10 +0000 Subject: [PATCH] --- source/hazard/hfalling.cpp | 41 +++++++++++++++++++++++++++----------- source/hazard/hfalling.h | 1 + 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/source/hazard/hfalling.cpp b/source/hazard/hfalling.cpp index ba18df390..a435c0a55 100644 --- a/source/hazard/hfalling.cpp +++ b/source/hazard/hfalling.cpp @@ -132,20 +132,37 @@ void CNpcFallingHazard::processMovement( int _frames ) if ( groundHeight < yMovement ) { - if ( m_soundId == NOT_PLAYING ) + switch ( CGameScene::getCollision()->getCollisionBlock( Pos.vx, Pos.vy + groundHeight + 8 ) & COLLISION_TYPE_MASK ) { - m_soundId = (int) CSoundMediator::playSfx( CSoundMediator::SFX_HAZARD__ACORN_LAND, true ); + case COLLISION_TYPE_FLAG_SOLID: + { + // drop down + + Pos.vy += yMovement; + + break; + } + + default: + { + if ( m_soundId == NOT_PLAYING ) + { + m_soundId = (int) CSoundMediator::playSfx( CSoundMediator::SFX_HAZARD__ACORN_LAND, true ); + } + + // colliding with ground + + Pos.vy += groundHeight; + + m_bounceFinish = true; + m_speed = -5; + m_bounceDir = getRnd() % 2; + + m_bouncePos = Pos; + + break; + } } - - // colliding with ground - - Pos.vy += groundHeight; - - m_bounceFinish = true; - m_speed = -5; - m_bounceDir = getRnd() % 2; - - m_bouncePos = Pos; } else { diff --git a/source/hazard/hfalling.h b/source/hazard/hfalling.h index 96ecb86ec..d724ef6e3 100644 --- a/source/hazard/hfalling.h +++ b/source/hazard/hfalling.h @@ -24,6 +24,7 @@ public: void init(); void setWaypoints( sThingHazard *ThisHazard ); void render(); + bool alwaysThink() {return(m_bounceFinish);} protected: void processMovement( int _frames ); void processTimer( int _frames );