]> git.itanic.dy.fi Git - sdl-planets/commit
quadtree: Be more careful when deleting a node from the tree
authorTimo Kokkonen <kaapeli@itanic.dy.fi>
Mon, 5 Apr 2010 12:43:43 +0000 (15:43 +0300)
committerTimo Kokkonen <kaapeli@itanic.dy.fi>
Mon, 5 Apr 2010 12:43:43 +0000 (15:43 +0300)
commitf0c70d1e652544a70f2ffc3c3c052916834e47a2
treef89c4635285bed4459f2fb61b9b3b703c6eb6505
parentd2ed1cd0cf28d2ebd1e1db51f49d907ac20af785
quadtree: Be more careful when deleting a node from the tree

Before attempting to move nodes back to the main tree, detach the
subtree completely from the main tree. When detaching individual nodes
from the tree, also ensure that each node has its old children
removed.

If these measures are not taken into account, loops will form in the
tree.

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
quadtree.c