Removed redundant calls.
This commit is contained in:
parent
e99159f3ea
commit
bde4dd84f5
|
@ -191,26 +191,20 @@ static int getIndex(Quadtree *root, int x, int y, int w, int h)
|
|||
|
||||
void removeFromQuadtree(Entity *e, Quadtree *root)
|
||||
{
|
||||
int index, i;
|
||||
|
||||
index = getIndex(root, e->x - (e->w / 2), e->y - (e->h / 2), e->w, e->h);
|
||||
|
||||
removeEntity(e, root);
|
||||
int index;
|
||||
|
||||
if (root->node[0])
|
||||
{
|
||||
index = getIndex(root, e->x - (e->w / 2), e->y - (e->h / 2), e->w, e->h);
|
||||
|
||||
if (index != -1)
|
||||
{
|
||||
removeFromQuadtree(e, root->node[index]);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
removeFromQuadtree(e, root->node[i]);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
removeEntity(e, root);
|
||||
}
|
||||
|
||||
static void removeEntity(Entity *e, Quadtree *root)
|
||||
|
|
Loading…
Reference in New Issue