From 45958bf2b5dd45ad1623877ed46e19bf87d84a1e Mon Sep 17 00:00:00 2001 From: Charles Date: Mon, 23 Apr 2001 15:12:44 +0000 Subject: [PATCH] --- source/enemy/npc.cpp | 3 ++- source/enemy/npcdata.cpp | 2 +- source/thing/thing.cpp | 24 ++++++++++++++++++++++++ source/thing/thing.h | 1 + 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/source/enemy/npc.cpp b/source/enemy/npc.cpp index 6256b3143..38af16164 100644 --- a/source/enemy/npc.cpp +++ b/source/enemy/npc.cpp @@ -798,8 +798,9 @@ void CNpcEnemy::shutdown() if (m_actorGfx) delete m_actorGfx; - CEnemyThing::shutdown(); + deleteAllChild(); + CEnemyThing::shutdown(); } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/enemy/npcdata.cpp b/source/enemy/npcdata.cpp index 14fe4fe9d..47cf165f5 100644 --- a/source/enemy/npcdata.cpp +++ b/source/enemy/npcdata.cpp @@ -1251,13 +1251,13 @@ CNpcPlatform::NPC_PLATFORM_UNIT_TYPE CNpcPlatform::mapEditConvertTable[NPC_PLATF { NPC_BUBBLE_PLATFORM, NPC_LINEAR_PLATFORM, + NPC_FALLING_PLATFORM, NPC_CIRCULAR_PLATFORM, NPC_COLLAPSING_BUBBLE_PLATFORM, NPC_FISH_HOOK_PLATFORM, NPC_RETRACTING_PLATFORM, NPC_GEYSER_PLATFORM, NPC_BOBBING_PLATFORM, - NPC_FALLING_PLATFORM, NPC_CART_PLATFORM, NPC_PLAYER_BUBBLE_PLATFORM, }; \ No newline at end of file diff --git a/source/thing/thing.cpp b/source/thing/thing.cpp index 0d37dae25..f2f098247 100644 --- a/source/thing/thing.cpp +++ b/source/thing/thing.cpp @@ -582,6 +582,30 @@ CThing *List=Next; m_numChildren = 0; } +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +void CThing::deleteAllChild() +{ +CThing *List=Next; + + while (List) + { + CThing *Next=List->Next; + List->Parent=NULL; + List->Next=NULL; + List->shutdown(); + delete List; + List=Next; + } + Next=NULL; + + m_numChildren = 0; +} + /*---------------------------------------------------------------------- Function: Purpose: diff --git a/source/thing/thing.h b/source/thing/thing.h index 72f012511..faa410b28 100644 --- a/source/thing/thing.h +++ b/source/thing/thing.h @@ -105,6 +105,7 @@ public: void addChild(CThing *Child); void removeChild(CThing *Child); void removeAllChild(); + void deleteAllChild(); bool hasChild(CThing *Child); int getNumChildren();