From a3e585e96084cc93449bc3e56dabaddb9de7e272 Mon Sep 17 00:00:00 2001 From: Charles Date: Wed, 25 Apr 2001 20:09:36 +0000 Subject: [PATCH] --- source/platform/pfishhk.cpp | 9 +-------- source/platform/pfishhk.h | 3 --- source/platform/platform.cpp | 10 ++++++++-- source/platform/platform.h | 4 ++++ 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/source/platform/pfishhk.cpp b/source/platform/pfishhk.cpp index ff08f4d4f..cf5a4024c 100644 --- a/source/platform/pfishhk.cpp +++ b/source/platform/pfishhk.cpp @@ -35,13 +35,6 @@ void CNpcFishHookPlatform::processLifetime( int _frames ) //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -void CNpcFishHookPlatform::setToShutdown() -{ - m_isShuttingDown = true; -} - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - void CNpcFishHookPlatform::processMovement( int _frames ) { if ( m_isMoving ) @@ -50,7 +43,7 @@ void CNpcFishHookPlatform::processMovement( int _frames ) if ( Pos.vy < 0 ) { - shutdown(); + setToShutdown(); } } } \ No newline at end of file diff --git a/source/platform/pfishhk.h b/source/platform/pfishhk.h index 36cdb1bb8..197f3d102 100644 --- a/source/platform/pfishhk.h +++ b/source/platform/pfishhk.h @@ -22,14 +22,11 @@ class CNpcFishHookPlatform : public CNpcPlatform { public: virtual void postInit(); - void setToShutdown(); - u8 isSetToShutdown() {return( m_isShuttingDown );} protected: virtual void processLifetime( int _frames ); virtual void processMovement( int _frames ); u8 m_isMoving; - u8 m_isShuttingDown; }; #endif \ No newline at end of file diff --git a/source/platform/platform.cpp b/source/platform/platform.cpp index 34be9c710..4bd9012dc 100644 --- a/source/platform/platform.cpp +++ b/source/platform/platform.cpp @@ -337,6 +337,13 @@ void CNpcPlatform::shutdown() //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +void CNpcPlatform::setToShutdown() +{ + m_isShuttingDown = true; +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + void CNpcPlatform::processLifetime( int _frames ) { switch( m_lifetimeType ) @@ -347,8 +354,7 @@ void CNpcPlatform::processLifetime( int _frames ) if ( m_lifetime <= 0 ) { - shutdown(); - delete this; + setToShutdown(); return; } diff --git a/source/platform/platform.h b/source/platform/platform.h index e097ee7fb..f81afe737 100644 --- a/source/platform/platform.h +++ b/source/platform/platform.h @@ -78,6 +78,9 @@ public: static NPC_PLATFORM_UNIT_TYPE getTypeFromMapEdit( u16 newType ); static CNpcPlatform *Create(sThingPlatform *ThisPlatform); + void setToShutdown(); + u8 isSetToShutdown() {return( m_isShuttingDown );} + protected: // NPC data structure definitions // @@ -176,6 +179,7 @@ protected: int m_frame; int m_animNo; CModelGfx *m_modelGfx; + u8 m_isShuttingDown; virtual void collidedWith(CThing *_thisThing);