This commit is contained in:
Charles 2001-06-28 19:31:56 +00:00
parent 2668b7ca7a
commit fc84e1f409
3 changed files with 14 additions and 3 deletions

View file

@ -49,7 +49,7 @@ void CNpcEnemyGenerator::think(int _frames)
CNpcEnemy *enemy; CNpcEnemy *enemy;
enemy=CNpcEnemy::Create( CNpcEnemy::NPC_SPIDER_CRAB ); 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(); u16 *waypointPtr = m_npcPath.getWaypointPtr();

View file

@ -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 ) void CNpcEnemy::setHeading( s32 xPos, s32 yPos )
{ {
m_heading = ( ratan2( ( ( yPos << 4 ) + 16 ) - Pos.vy, ( ( xPos << 4 ) + 8 ) - Pos.vx ) ) & 4095; m_heading = ( ratan2( ( ( yPos << 4 ) + 16 ) - Pos.vy, ( ( xPos << 4 ) + 8 ) - Pos.vx ) ) & 4095;

View file

@ -110,6 +110,7 @@ public:
void setWaypointCount( u8 newCount ) {m_npcPath.setWaypointCount( newCount );} void setWaypointCount( u8 newCount ) {m_npcPath.setWaypointCount( newCount );}
void setPathType( u8 newType ) {m_npcPath.setPathType( newType );} void setPathType( u8 newType ) {m_npcPath.setPathType( newType );}
void setStartPos( s32 xPos, s32 yPos ); void setStartPos( s32 xPos, s32 yPos );
void setStartPosHighRes( s32 xPos, s32 yPos );
virtual u8 hasBeenAttacked(); virtual u8 hasBeenAttacked();
virtual void hasBeenSteamed( DVECTOR &steamPos ) {hasBeenAttacked();} virtual void hasBeenSteamed( DVECTOR &steamPos ) {hasBeenAttacked();}
virtual u8 canBeCaughtByNet(); virtual u8 canBeCaughtByNet();