diff --git a/source/enemy/ngen.cpp b/source/enemy/ngen.cpp index 3c7aaab50..133084e18 100644 --- a/source/enemy/ngen.cpp +++ b/source/enemy/ngen.cpp @@ -49,7 +49,7 @@ void CNpcEnemyGenerator::think(int _frames) CNpcEnemy *enemy; enemy=CNpcEnemy::Create( CNpcEnemy::NPC_SPIDER_CRAB ); - enemy->setStartPos( ( Pos.vx - 8 ) >> 4, ( Pos.vy - 16 ) >> 4 ); + enemy->setStartPosHighRes( Pos.vx, Pos.vy - 8 ); u16 *waypointPtr = m_npcPath.getWaypointPtr(); diff --git a/source/enemy/npc.cpp b/source/enemy/npc.cpp index d6be950a4..854355db3 100644 --- a/source/enemy/npc.cpp +++ b/source/enemy/npc.cpp @@ -568,6 +568,16 @@ void CNpcEnemy::setStartPos( s32 xPos, s32 yPos ) //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +void CNpcEnemy::setStartPosHighRes( s32 xPos, s32 yPos ) +{ + Pos.vx = xPos; + Pos.vy = yPos; + + m_initPos = m_base = Pos; +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + void CNpcEnemy::setHeading( s32 xPos, s32 yPos ) { m_heading = ( ratan2( ( ( yPos << 4 ) + 16 ) - Pos.vy, ( ( xPos << 4 ) + 8 ) - Pos.vx ) ) & 4095; @@ -1587,7 +1597,7 @@ bool CNpcEnemy::processCoralBlowerMovement( int _frames, s32 xDist, s32 yDist, u { s32 moveX, moveY; s16 headingToTarget; - + headingToTarget = ratan2( yDist, xDist ); s32 preShiftX = _frames * 3 * rcos( headingToTarget ); @@ -1774,4 +1784,4 @@ void CNpcEnemy::processCoralBlower( int _frames ) } m_isBlowerOn = false; -} +} \ No newline at end of file diff --git a/source/enemy/npc.h b/source/enemy/npc.h index 7f6ed2684..5661a3d85 100644 --- a/source/enemy/npc.h +++ b/source/enemy/npc.h @@ -110,6 +110,7 @@ public: void setWaypointCount( u8 newCount ) {m_npcPath.setWaypointCount( newCount );} void setPathType( u8 newType ) {m_npcPath.setPathType( newType );} void setStartPos( s32 xPos, s32 yPos ); + void setStartPosHighRes( s32 xPos, s32 yPos ); virtual u8 hasBeenAttacked(); virtual void hasBeenSteamed( DVECTOR &steamPos ) {hasBeenAttacked();} virtual u8 canBeCaughtByNet();