From 63341230713d188cf849f36b3119774aea850741 Mon Sep 17 00:00:00 2001 From: Charles Date: Wed, 23 May 2001 19:11:51 +0000 Subject: [PATCH] --- source/hazard/hfirebal.cpp | 18 ++++++++++++------ source/hazard/hfirebal.h | 2 ++ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/source/hazard/hfirebal.cpp b/source/hazard/hfirebal.cpp index 548ac933d..cb9685bf0 100644 --- a/source/hazard/hfirebal.cpp +++ b/source/hazard/hfirebal.cpp @@ -32,6 +32,7 @@ void CNpcFireballHazard::init() m_extension = 0; m_velocity = 40; + m_height = 50; m_respawnRate = 4; } @@ -51,6 +52,8 @@ void CNpcFireballHazard::setWaypoints( sThingHazard *ThisHazard ) newYPos = (u16) *PntList; PntList++; + addWaypoint( newXPos, newYPos ); + DVECTOR startPos; startPos.vx = newXPos << 4; startPos.vy = newYPos << 4; @@ -74,6 +77,13 @@ void CNpcFireballHazard::setWaypoints( sThingHazard *ThisHazard ) { addWaypoint( newXPos, newYPos ); } + + s32 minX, maxX, minY, maxY; + + m_npcPath.getPathXExtents( &minX, &maxX ); + m_width = maxX - minX; + m_npcPath.getPathYExtents( &minY, &maxY ); + m_height = maxY - minY; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -81,10 +91,6 @@ void CNpcFireballHazard::setWaypoints( sThingHazard *ThisHazard ) void CNpcFireballHazard::processMovement( int _frames ) { s32 velocity; - s32 distSourceX; - s32 distSourceY; - - m_npcPath.getDistToNextWaypoint( m_base, &distSourceX, &distSourceY ); if ( m_extension < 4096 ) { @@ -110,8 +116,8 @@ void CNpcFireballHazard::processMovement( int _frames ) return; } - Pos.vx = m_base.vx + ( ( distSourceX * m_extension ) >> 12 ); - Pos.vy = m_base.vy - ( 50 * rsin( m_extension >> 1 ) >> 12 ); + Pos.vx = m_base.vx + ( ( m_width * m_extension ) >> 12 ); + Pos.vy = m_base.vy - ( m_height * rsin( m_extension >> 1 ) >> 12 ); } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/hazard/hfirebal.h b/source/hazard/hfirebal.h index 6537674a8..f51479dd8 100644 --- a/source/hazard/hfirebal.h +++ b/source/hazard/hfirebal.h @@ -28,6 +28,8 @@ protected: void processTimer( int _frames ); s32 m_velocity; + s32 m_width; + s32 m_height; }; #endif \ No newline at end of file