diff --git a/decompile/src/JSRF/Core.cpp b/decompile/src/JSRF/Core.cpp index 84141ab..3a5415c 100644 --- a/decompile/src/JSRF/Core.cpp +++ b/decompile/src/JSRF/Core.cpp @@ -184,7 +184,13 @@ void GameObj::removeFromObjList(GameObj * obj) { void GameObj::removeChildrenFromObjList(GameObj * firstChild) { if (firstChild != NULL) do { if (firstChild->flags > -1) { + firstChild->flags = GameObjFlags(firstChild->flags | GOF_DELETEAFTEREXEC); + g_game->removeFromDrawList(firstChild); + g_game->unsetObj(firstChild->index); } + + this->removeChildrenFromObjList(firstChild->firstChild); + firstChild = firstChild->nextSibling; } while (firstChild != NULL); } diff --git a/decompile/src/JSRF/Core.hpp b/decompile/src/JSRF/Core.hpp index 90be3fe..b876b63 100644 --- a/decompile/src/JSRF/Core.hpp +++ b/decompile/src/JSRF/Core.hpp @@ -139,7 +139,6 @@ struct GameObj { void removeFromObjList (GameObj * obj); void removeChildrenFromObjList(GameObj * firstChild); - // Each frame, one of these trios of methods is called depending on // which state the game is in // Default implementation of each does nothing; inheriting objects