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;
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();
@ -62,6 +62,7 @@ void CNpcEnemyGenerator::think(int _frames)
enemy->setPathType( m_npcPath.getPathType() );
enemy->postInit();
enemy->setThinkArea();
enemy->updateCollisionArea();
addChild( enemy );

View file

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

View file

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

View file

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