diff --git a/source/enemy/ngen.cpp b/source/enemy/ngen.cpp index 453bf71f9..3c7aaab50 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 >> 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 ); diff --git a/source/enemy/ngen.h b/source/enemy/ngen.h index ae05b8ff7..83b3ece17 100644 --- a/source/enemy/ngen.h +++ b/source/enemy/ngen.h @@ -26,6 +26,7 @@ public: void render(); void think(int _frames); virtual u8 canCollideWithEnemy() {return( false );} + virtual CRECT const *getThinkBBox() {return( CThing::getThinkBBox() );} }; #endif \ No newline at end of file diff --git a/source/enemy/npc.cpp b/source/enemy/npc.cpp index 2eefb0126..a07f49653 100644 --- a/source/enemy/npc.cpp +++ b/source/enemy/npc.cpp @@ -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 ); diff --git a/source/enemy/npc.h b/source/enemy/npc.h index c2fe211a0..7f6ed2684 100644 --- a/source/enemy/npc.h +++ b/source/enemy/npc.h @@ -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 );