diff --git a/source/enemy/npc.cpp b/source/enemy/npc.cpp index 68c631bcc..908023d2c 100644 --- a/source/enemy/npc.cpp +++ b/source/enemy/npc.cpp @@ -623,7 +623,7 @@ void CNpcEnemy::init() m_npcPath.initPath(); - m_isShuttingDown = false; +// m_isShuttingDown = false; m_drawRotation = 0; m_isCaught = false; m_isBlowerOn = false; @@ -684,13 +684,6 @@ void CNpcEnemy::shutdown() //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -void CNpcEnemy::setToShutdown() -{ - m_isShuttingDown = true; -} - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - int CNpcEnemy::getFrameCount() { return( m_actorGfx->getFrameCount( m_animNo ) ); diff --git a/source/enemy/npc.h b/source/enemy/npc.h index e2ec595f7..a088c4474 100644 --- a/source/enemy/npc.h +++ b/source/enemy/npc.h @@ -115,9 +115,6 @@ public: virtual int canCollide(); - void setToShutdown(); - u8 isSetToShutdown() {return( m_isShuttingDown );} - bool canBeSuckedUp(); bool suckUp( DVECTOR *suckPos, int _frames ); @@ -307,8 +304,6 @@ protected: POLY_FT4 *SprFrame; virtual void collidedWith(CThing *_thisThing); - - u8 m_isShuttingDown; s16 m_drawRotation; }; diff --git a/source/fx/fx.h b/source/fx/fx.h index 96bff2e71..8a03422fc 100644 --- a/source/fx/fx.h +++ b/source/fx/fx.h @@ -61,8 +61,6 @@ virtual void think(int _frames); virtual void render(); virtual int canCollide() {return false;} -virtual u8 isSetToShutdown() {return( false );} - virtual void SetOtPos(int Ot) {OtPos=Ot;} protected: diff --git a/source/fx/fxfallingtile.cpp b/source/fx/fxfallingtile.cpp index 178f7236c..4696381e9 100644 --- a/source/fx/fxfallingtile.cpp +++ b/source/fx/fxfallingtile.cpp @@ -54,7 +54,8 @@ void CFXFallingTile::think(int _frames) Pos.vx+=Velocity.vx; Pos.vy+=Velocity.vy; Velocity.vy++; - if (Life) Life--; + Life--; + if (!Life) setToShutdown(); } /*****************************************************************************/ diff --git a/source/fx/fxfallingtile.h b/source/fx/fxfallingtile.h index 9353ba43d..afe4ccd8e 100644 --- a/source/fx/fxfallingtile.h +++ b/source/fx/fxfallingtile.h @@ -16,8 +16,6 @@ virtual void init(DVECTOR const &Pos); virtual void shutdown(); virtual void think(int _frames); virtual void render(); -virtual u8 isSetToShutdown() {return(Life<=0);} - void SetTile(int T) {Tile=T;} protected: diff --git a/source/platform/platform.cpp b/source/platform/platform.cpp index 1ebbf52f6..aa3501d20 100644 --- a/source/platform/platform.cpp +++ b/source/platform/platform.cpp @@ -535,13 +535,6 @@ void CNpcPlatform::shutdown() //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -void CNpcPlatform::setToShutdown() -{ - m_isShuttingDown = true; -} - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - void CNpcPlatform::processLifetime( int _frames ) { switch( m_lifetimeType ) diff --git a/source/platform/platform.h b/source/platform/platform.h index 5944c9757..7811663b6 100644 --- a/source/platform/platform.h +++ b/source/platform/platform.h @@ -110,9 +110,6 @@ public: static NPC_PLATFORM_UNIT_TYPE getTypeFromMapEdit( u16 newType ); static CNpcPlatform *Create(sThingPlatform *ThisPlatform); - void setToShutdown(); - u8 isSetToShutdown() {return( m_isShuttingDown );} - void setSpeed( s16 newSpeed ) {m_speed = newSpeed;} protected: diff --git a/source/projectl/projectl.cpp b/source/projectl/projectl.cpp index 89e5ebecd..18e4cee8a 100644 --- a/source/projectl/projectl.cpp +++ b/source/projectl/projectl.cpp @@ -46,6 +46,7 @@ #ifndef __ENEMY_NPC_H__ #include "enemy\npc.h" #endif +#include "gfx\otpos.h" /*****************************************************************************/ @@ -64,8 +65,8 @@ void CProjectile::init() m_state = PROJECTILE_ATTACK; m_turnSpeed = 256; m_extension = 0; - m_isShuttingDown = false; - m_ot = 0; +// m_isShuttingDown = false; + m_ot = OTPOS__ACTOR_POS; updateCollisionArea(); } @@ -99,11 +100,6 @@ void CProjectile::shutdown() CEnemyProjectileThing::shutdown(); } -void CProjectile::setToShutdown() -{ - m_isShuttingDown = true; -} - bool CProjectile::processTargetSeek( int _frames, DVECTOR targetPos ) { s32 moveX = 0, moveY = 0; @@ -411,7 +407,7 @@ void CPlayerProjectile::init() m_extension = 0; m_frame = 0; m_reversed = 0; - m_isShuttingDown = false; +// m_isShuttingDown = false; } void CPlayerProjectile::init( DVECTOR initPos, s16 initHeading ) @@ -449,11 +445,6 @@ void CPlayerProjectile::shutdown() CPlayerProjectileThing::shutdown(); } -void CPlayerProjectile::setToShutdown() -{ - m_isShuttingDown = true; -} - void CPlayerProjectile::setMovementType( PLAYER_PROJECTILE_MOVEMENT_TYPE moveType ) { m_movementType = moveType; diff --git a/source/projectl/projectl.h b/source/projectl/projectl.h index b727b66ee..caac8b5ea 100644 --- a/source/projectl/projectl.h +++ b/source/projectl/projectl.h @@ -48,8 +48,6 @@ public: void init( DVECTOR initPos, s16 initHeading, PROJECTILE_MOVEMENT_TYPE initMoveType, PROJECTILE_LIFETIME_TYPE initLifeType ); void init( DVECTOR initPos, s16 initHeading, PROJECTILE_MOVEMENT_TYPE initMoveType, PROJECTILE_LIFETIME_TYPE initLifeType, s32 initLifetime ); void shutdown(); - void setToShutdown(); - u8 isSetToShutdown() {return( m_isShuttingDown );} void think(int _frames); void setPos( DVECTOR newPos ) {Pos = newPos;} virtual void render(); @@ -79,7 +77,6 @@ protected: PROJECTILE_LIFETIME_TYPE m_lifetimeType; PROJECTILE_STATE m_state; u16 m_turnSpeed; - u8 m_isShuttingDown; u8 m_ot; }; @@ -104,8 +101,6 @@ public: void init( DVECTOR initPos, s16 initHeading, PLAYER_PROJECTILE_MOVEMENT_TYPE initMoveType, PLAYER_PROJECTILE_LIFETIME_TYPE initLifeType ); void init( DVECTOR initPos, s16 initHeading, PLAYER_PROJECTILE_MOVEMENT_TYPE initMoveType, PLAYER_PROJECTILE_LIFETIME_TYPE initLifeType, s32 initLifetime ); void shutdown(); - void setToShutdown(); - u8 isSetToShutdown() {return( m_isShuttingDown );} virtual void think(int _frames); virtual void render(); void processEvent( GAME_EVENT evt, CThing *sourceThing ); @@ -133,7 +128,6 @@ protected: int m_frame; POLY_FT4 *SprFrame; u8 m_reversed; - u8 m_isShuttingDown; }; diff --git a/source/thing/thing.h b/source/thing/thing.h index ce2d87975..2e6d7df96 100644 --- a/source/thing/thing.h +++ b/source/thing/thing.h @@ -105,7 +105,7 @@ public: MAX_TYPE, }; // TYPE; - CThing() {;} + CThing() {m_isShuttingDown=false;} virtual ~CThing() {;} virtual TYPE getThingType()=0; @@ -114,7 +114,8 @@ virtual void init(); virtual void shutdown(); virtual void think(int _frames); virtual void render(); -virtual u8 isSetToShutdown() {return( false );} + void setToShutdown() {m_isShuttingDown = true;} + u8 isSetToShutdown() {return( m_isShuttingDown);} virtual int dontKillDuringLevelRespawn() {return false;} // Linkage @@ -193,6 +194,7 @@ private: bool m_renderFlag,m_thinkFlag; DVECTOR m_RenderPos; + bool m_isShuttingDown; }; /*---------------------------------------------------------------------- */