This commit is contained in:
Charles 2001-06-26 19:23:55 +00:00
parent 13cca1815f
commit a01a13d45b
4 changed files with 11 additions and 1 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 >> 4, Pos.vy >> 4 ); enemy->setStartPos( ( Pos.vx - 8 ) >> 4, ( Pos.vy - 16 ) >> 4 );
u16 *waypointPtr = m_npcPath.getWaypointPtr(); u16 *waypointPtr = m_npcPath.getWaypointPtr();
@ -62,6 +62,7 @@ void CNpcEnemyGenerator::think(int _frames)
enemy->setPathType( m_npcPath.getPathType() ); enemy->setPathType( m_npcPath.getPathType() );
enemy->postInit(); enemy->postInit();
enemy->setThinkArea();
enemy->updateCollisionArea(); enemy->updateCollisionArea();
addChild( enemy ); addChild( enemy );

View file

@ -26,6 +26,7 @@ public:
void render(); void render();
void think(int _frames); void think(int _frames);
virtual u8 canCollideWithEnemy() {return( false );} virtual u8 canCollideWithEnemy() {return( false );}
virtual CRECT const *getThinkBBox() {return( CThing::getThinkBBox() );}
}; };
#endif #endif

View file

@ -520,6 +520,13 @@ void CNpcEnemy::setupWaypoints( sThingActor *ThisActor )
setHeading( newXPos, newYPos ); setHeading( newXPos, newYPos );
} }
setThinkArea();
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcEnemy::setThinkArea()
{
s32 minX, maxX, minY, maxY; s32 minX, maxX, minY, maxY;
m_npcPath.getPathXExtents( &minX, &maxX ); m_npcPath.getPathXExtents( &minX, &maxX );

View file

@ -126,6 +126,7 @@ public:
virtual int canCollide(); virtual int canCollide();
virtual CRECT const *getThinkBBox() {return &m_thinkArea;} virtual CRECT const *getThinkBBox() {return &m_thinkArea;}
void setThinkArea();
bool canBeSuckedUp(); bool canBeSuckedUp();
bool suckUp( DVECTOR *suckPos, int _frames ); bool suckUp( DVECTOR *suckPos, int _frames );