This commit is contained in:
Charles 2001-03-30 17:26:29 +00:00
parent 20932475a1
commit 45ba12e721

View file

@ -261,6 +261,8 @@ void CNpcEnemy::init()
setCollisionCentreOffset( 0, -( ofs.vy >> 1 ) ); setCollisionCentreOffset( 0, -( ofs.vy >> 1 ) );
m_positionHistory = NULL;
switch ( m_data[this->m_type].initFunc ) switch ( m_data[this->m_type].initFunc )
{ {
case NPC_INIT_DEFAULT: case NPC_INIT_DEFAULT:
@ -521,8 +523,27 @@ void CNpcEnemy::init()
void CNpcEnemy::shutdown() void CNpcEnemy::shutdown()
{ {
// remove waypoints
m_npcPath.removeAllWaypoints(); m_npcPath.removeAllWaypoints();
// remove position history
CNpcPositionHistory *currentPosition;
CNpcPositionHistory *oldPosition;
currentPosition = m_positionHistory;
while( currentPosition )
{
oldPosition = currentPosition;
currentPosition = currentPosition->next;
delete oldPosition;
}
m_positionHistory = NULL;
// temporary // temporary
TPFree( m_actorTPage ); TPFree( m_actorTPage );
CEnemyThing::shutdown(); CEnemyThing::shutdown();