From c8a5d2ec68b5b46167955d6cfb1fcec3e1b3da3c Mon Sep 17 00:00:00 2001 From: "Colton G. Rushton" Date: Sun, 17 May 2020 05:49:34 -0300 Subject: [PATCH] Fix unused code --- src/game/spawn_object.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/game/spawn_object.c b/src/game/spawn_object.c index cc15c8e9..79f930f2 100644 --- a/src/game/spawn_object.c +++ b/src/game/spawn_object.c @@ -161,8 +161,7 @@ void clear_object_lists(struct ObjectNode *objLists) { } /** - * This function looks broken, but it appears to attempt to delete the leaf - * graph nodes under obj and obj's siblings. + * Delete the leaf graph nodes under obj and obj's siblings. */ static void unused_delete_leaf_nodes(struct Object *obj) { struct Object *children; @@ -176,8 +175,7 @@ static void unused_delete_leaf_nodes(struct Object *obj) { mark_obj_for_deletion(obj); } - // Probably meant to be != - while ((sibling = (struct Object *) obj->header.gfx.node.next) == obj0) { + while ((sibling = (struct Object *) obj->header.gfx.node.next) != obj0) { unused_delete_leaf_nodes(sibling); obj = (struct Object *) sibling->header.gfx.node.next; }