From 3fad61a8f9466bdacb9fdabbdb1596f69e247d68 Mon Sep 17 00:00:00 2001 From: Charles Date: Thu, 3 May 2001 22:15:13 +0000 Subject: [PATCH] --- source/enemy/nfdutch.cpp | 5 +++-- source/enemy/nfdutch.h | 2 ++ source/enemy/npcpath.cpp | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/source/enemy/nfdutch.cpp b/source/enemy/nfdutch.cpp index 3be83882b..2acea7216 100644 --- a/source/enemy/nfdutch.cpp +++ b/source/enemy/nfdutch.cpp @@ -42,6 +42,7 @@ void CNpcFlyingDutchmanEnemy::postInit() s32 minX, maxX; m_npcPath.getPathXExtents( &minX, &maxX ); + m_npcPath.getPathYExtents( &m_minY, &m_maxY ); m_extension = minX; } @@ -70,7 +71,7 @@ void CNpcFlyingDutchmanEnemy::processMovement( int _frames ) { if ( m_extendDir == EXTEND_UP ) { - s32 yDist = -10 - Pos.vy; + s32 yDist = m_minY - Pos.vy; s32 yDistSqr = yDist * yDist; if ( yDistSqr > 100 ) @@ -84,7 +85,7 @@ void CNpcFlyingDutchmanEnemy::processMovement( int _frames ) } else { - s32 yDist = 400 - Pos.vy; + s32 yDist = m_maxY - Pos.vy; s32 yDistSqr = yDist * yDist; if ( yDistSqr > 100 ) diff --git a/source/enemy/nfdutch.h b/source/enemy/nfdutch.h index 67c95e31d..26d63e564 100644 --- a/source/enemy/nfdutch.h +++ b/source/enemy/nfdutch.h @@ -28,6 +28,8 @@ protected: FLYING_DUTCHMAN_ATTACK_PLAYER_2 = 1, FLYING_DUTCHMAN_ATTACK_PLAYER_3, }; + + s32 m_minY, m_maxY; }; #endif \ No newline at end of file diff --git a/source/enemy/npcpath.cpp b/source/enemy/npcpath.cpp index 88495b131..f445b1a88 100644 --- a/source/enemy/npcpath.cpp +++ b/source/enemy/npcpath.cpp @@ -108,7 +108,8 @@ void CNpcPath::addWaypoint( DVECTOR newPos ) currentWaypoint = this->waypoint; - minX = maxX = minY = maxY = newPos.vx; + minX = maxX = newPos.vx; + minY = maxY = newPos.vy; } }