This commit is contained in:
Charles 2001-05-29 22:07:28 +00:00
parent 9f667e7bbc
commit c7e46d02ef
24 changed files with 328 additions and 469 deletions

View file

@ -306,7 +306,10 @@ void CNpcHazard::setWaypoints( sThingHazard *ThisHazard )
u16 newXPos, newYPos;
m_npcPath.setWaypointCount( ThisHazard->PointCount - 1 );
newXPos = (u16) *PntList;
setWaypointPtr( PntList );
PntList++;
newYPos = (u16) *PntList;
PntList++;
@ -317,33 +320,6 @@ void CNpcHazard::setWaypoints( sThingHazard *ThisHazard )
Pos = startPos;
m_base = Pos;
addWaypoint( newXPos, newYPos );
if ( ThisHazard->PointCount > 1 )
{
for ( pointNum = 1 ; pointNum < ThisHazard->PointCount ; pointNum++ )
{
newXPos = (u16) *PntList;
PntList++;
newYPos = (u16) *PntList;
PntList++;
addWaypoint( newXPos, newYPos );
}
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcHazard::addWaypoint( s32 xPos, s32 yPos )
{
DVECTOR newPos;
newPos.vx = xPos << 4;
newPos.vy = yPos << 4;
m_npcPath.addWaypoint( newPos );
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -391,7 +367,7 @@ void CNpcHazard::shutdown()
delete m_modelGfx;
// remove waypoints
m_npcPath.removeAllWaypoints();
//m_npcPath.removeAllWaypoints();
//if (m_actorGfx) delete m_actorGfx;

View file

@ -70,7 +70,8 @@ public:
void think(int _frames);
virtual void render();
virtual void setWaypoints( sThingHazard *ThisHazard );
void addWaypoint( s32 xPos, s32 yPos );
void setWaypointPtr( u16 *newPtr ) {m_npcPath.setWaypointPtr( newPtr );}
void setWaypointCount( u8 newCount ) {m_npcPath.setWaypointCount( newCount );}
virtual void setRespawnRate( s16 newRespawnRate ) {m_respawnRate=newRespawnRate;}
static NPC_HAZARD_UNIT_TYPE getTypeFromMapEdit( u16 newType );

View file

@ -213,7 +213,10 @@ void CNpcFallingHazard::setWaypoints( sThingHazard *ThisHazard )
u16 newXPos, newYPos;
m_npcPath.setWaypointCount( ThisHazard->PointCount - 1 );
newXPos = (u16) *PntList;
setWaypointPtr( PntList );
PntList++;
newYPos = (u16) *PntList;
PntList++;
@ -224,21 +227,6 @@ void CNpcFallingHazard::setWaypoints( sThingHazard *ThisHazard )
Pos = startPos;
m_base = Pos;
addWaypoint( newXPos, newYPos );
if ( ThisHazard->PointCount > 1 )
{
for ( pointNum = 1 ; pointNum < ThisHazard->PointCount ; pointNum++ )
{
newXPos = (u16) *PntList;
PntList++;
newYPos = (u16) *PntList;
PntList++;
addWaypoint( newXPos, newYPos );
}
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View file

@ -47,13 +47,14 @@ void CNpcFireballHazard::setWaypoints( sThingHazard *ThisHazard )
u16 newXPos, newYPos;
m_npcPath.setWaypointCount( ThisHazard->PointCount - 1 );
newXPos = (u16) *PntList;
setWaypointPtr( PntList );
PntList++;
newYPos = (u16) *PntList;
PntList++;
addWaypoint( newXPos, newYPos );
DVECTOR startPos;
startPos.vx = newXPos << 4;
startPos.vy = newYPos << 4;
@ -61,23 +62,6 @@ void CNpcFireballHazard::setWaypoints( sThingHazard *ThisHazard )
Pos = startPos;
m_base = Pos;
if ( ThisHazard->PointCount > 1 )
{
for ( pointNum = 1 ; pointNum < ThisHazard->PointCount ; pointNum++ )
{
newXPos = (u16) *PntList;
PntList++;
newYPos = (u16) *PntList;
PntList++;
addWaypoint( newXPos, newYPos );
}
}
else
{
addWaypoint( newXPos, newYPos );
}
s32 minX, maxX, minY, maxY;
m_npcPath.getPathXExtents( &minX, &maxX );

View file

@ -30,7 +30,7 @@ void CNpcSawbladeHazard::init()
newPos.vx = 300;
newPos.vy = 100;
m_npcPath.addWaypoint( newPos );
//m_npcPath.addWaypoint( newPos );
m_npcPath.setPathType( CNpcPath::SINGLE_USE_PATH );
}