This commit is contained in:
Charles 2001-04-25 20:04:25 +00:00
parent c501e386a0
commit 51249170a7
4 changed files with 55 additions and 33 deletions

View file

@ -779,10 +779,6 @@ void CNpcEnemy::reinit()
void CNpcEnemy::shutdown()
{
if ( !m_isShuttingDown )
{
m_isShuttingDown = true;
if (m_spriteBank) m_spriteBank->dump(); delete m_spriteBank;
// remove waypoints
@ -810,7 +806,13 @@ void CNpcEnemy::shutdown()
deleteAllChild();
CEnemyThing::shutdown();
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcEnemy::setToShutdown()
{
m_isShuttingDown = true;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -1283,7 +1285,7 @@ void CNpcEnemy::processShot()
}
else
{
shutdown();
setToShutdown();
}
}
@ -1479,7 +1481,7 @@ void CNpcEnemy::caughtWithNet()
}
else
{
shutdown();
setToShutdown();
}
}

View file

@ -182,6 +182,8 @@ public:
virtual int canCollide();
void setToShutdown();
u8 isSetToShutdown() {return( m_isShuttingDown );}
protected:
class CLayerCollision *m_layerCollision;

View file

@ -17,6 +17,14 @@
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcFishHookPlatform::postInit()
{
m_isMoving = false;
m_isShuttingDown = false;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcFishHookPlatform::processLifetime( int _frames )
{
if ( m_contact )
@ -27,6 +35,13 @@ void CNpcFishHookPlatform::processLifetime( int _frames )
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcFishHookPlatform::setToShutdown()
{
m_isShuttingDown = true;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcFishHookPlatform::processMovement( int _frames )
{
if ( m_isMoving )

View file

@ -21,12 +21,15 @@
class CNpcFishHookPlatform : public CNpcPlatform
{
public:
virtual void postInit() {m_isMoving = false;}
virtual void postInit();
void setToShutdown();
u8 isSetToShutdown() {return( m_isShuttingDown );}
protected:
virtual void processLifetime( int _frames );
virtual void processMovement( int _frames );
bool m_isMoving;
u8 m_isMoving;
u8 m_isShuttingDown;
};
#endif