Don't kill entity stuck inside another, just remove from quadtree.

This commit is contained in:
Steve 2018-03-14 22:42:15 +00:00
parent 370adf36b6
commit 2f2ee2a8cd
1 changed files with 3 additions and 3 deletions

View File

@ -670,11 +670,11 @@ static void moveToOthers(float dx, float dy, PointF *position)
{ {
hit = 1; hit = 1;
/* Infinite loop! Kill it! */ /* infinite loop - remove these from the quadtree */
if (dx == 0 && dy == 0 && solidLoopHits++ > 1) if (dx == 0 && dy == 0 && solidLoopHits++ > 1)
{ {
self->alive = ALIVE_DEAD; removeFromQuadtree(self, &world.quadtree);
printf("Warning: Killed stuck entity '%s', stuck in '%s'\n", self->name, e->name); removeFromQuadtree(e, &world.quadtree);
return; return;
} }
} }