diff --git a/source/hazard/hmasher.cpp b/source/hazard/hmasher.cpp index bf13b2ef3..29aa35054 100644 --- a/source/hazard/hmasher.cpp +++ b/source/hazard/hmasher.cpp @@ -29,6 +29,7 @@ void CNpcMasherHazard::init() CNpcHazard::init(); m_state = MASHER_DROPPING; + m_pauseTimer = 0; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -39,27 +40,34 @@ void CNpcMasherHazard::processMovement( int _frames ) { case MASHER_DROPPING: { - s8 yMovement = 3 * _frames; - - s8 groundHeight; - - groundHeight = CGameScene::getCollision()->getHeightFromGround( Pos.vx, Pos.vy, yMovement + 16 ); - - if ( groundHeight < yMovement ) + if ( m_pauseTimer <= 0 ) { - // colliding with ground + s8 yMovement = 3 * _frames; - Pos.vy += groundHeight; + s8 groundHeight; - // pause and change direction + groundHeight = CGameScene::getCollision()->getHeightFromGround( Pos.vx, Pos.vy, yMovement + 16 ); - m_state = MASHER_RISING; + if ( groundHeight < yMovement ) + { + // colliding with ground + + Pos.vy += groundHeight; + + // pause and change direction + + m_state = MASHER_RISING; + } + else + { + // drop down + + Pos.vy += yMovement; + } } else { - // drop down - - Pos.vy += yMovement; + m_pauseTimer -= _frames; } break; @@ -70,6 +78,8 @@ void CNpcMasherHazard::processMovement( int _frames ) if ( m_base.vx - Pos.vx == 0 && m_base.vy - Pos.vy == 0 ) { m_state = MASHER_DROPPING; + + m_pauseTimer = GameState::getOneSecondInFrames(); } else { diff --git a/source/hazard/hmasher.h b/source/hazard/hmasher.h index c0a6897c2..c7fdde3ef 100644 --- a/source/hazard/hmasher.h +++ b/source/hazard/hmasher.h @@ -33,6 +33,8 @@ protected: }; MASHER_STATE m_state; + + int m_pauseTimer; }; #endif \ No newline at end of file diff --git a/source/triggers/trestart.cpp b/source/triggers/trestart.cpp index 06e2d2553..1742251af 100644 --- a/source/triggers/trestart.cpp +++ b/source/triggers/trestart.cpp @@ -64,7 +64,7 @@ void CRestartPointTrigger::collidedWith(CThing *_thisThing) collisionArea=getCollisionArea(); respawnPos.vx=collisionArea.x1+((collisionArea.x2-collisionArea.x1)/2); respawnPos.vy=collisionArea.y2; - ((CPlayer*)_thisThing)->setRespawnPosAndRingTelephone(respawnPos); + ((CPlayer*)_thisThing)->setRespawnPos(respawnPos); break; }