This commit is contained in:
parent
6a94ade948
commit
b0a6481b14
4 changed files with 163 additions and 147 deletions
|
@ -272,40 +272,8 @@ void CGameScene::initLevel()
|
|||
{
|
||||
CNpcEnemy *enemy;
|
||||
enemy=CNpcEnemy::Create(ThisActor);
|
||||
enemy->setTypeFromMapEdit( ThisActor->Type );
|
||||
enemy->init();
|
||||
enemy->setLayerCollision( Level.getCollisionLayer() );
|
||||
|
||||
u16 *PntList=(u16*)MakePtr(ThisActor,sizeof(sThingActor));
|
||||
|
||||
u16 newXPos, newYPos;
|
||||
|
||||
newXPos = (u16) *PntList;
|
||||
PntList++;
|
||||
newYPos = (u16) *PntList;
|
||||
PntList++;
|
||||
|
||||
enemy->setStartPos( newXPos, newYPos );
|
||||
enemy->addWaypoint( newXPos, newYPos );
|
||||
|
||||
if ( ThisActor->PointCount > 1 )
|
||||
{
|
||||
for (pointNum = 1 ; pointNum < ThisActor->PointCount ; pointNum++ )
|
||||
{
|
||||
newXPos = (u16) *PntList;
|
||||
PntList++;
|
||||
newYPos = (u16) *PntList;
|
||||
PntList++;
|
||||
|
||||
enemy->addWaypoint( newXPos, newYPos );
|
||||
|
||||
if ( pointNum == 1 )
|
||||
{
|
||||
enemy->setHeading( newXPos, newYPos );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
enemy->setupWaypoints( ThisActor );
|
||||
enemy->postInit();
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue