Don't kill entity stuck inside another, just remove from quadtree.
This commit is contained in:
parent
370adf36b6
commit
2f2ee2a8cd
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue