From b40936fd79217cc6bb831706fe2ac42da57699d9 Mon Sep 17 00:00:00 2001 From: Steve Date: Fri, 15 Apr 2016 13:08:30 +0100 Subject: [PATCH] Always add ents to quadtree, to allow AI to see components. Shuffle around later. --- src/battle/entities.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/battle/entities.c b/src/battle/entities.c index 79ed9f5..0d77b01 100644 --- a/src/battle/entities.c +++ b/src/battle/entities.c @@ -148,23 +148,20 @@ void doEntities(void) e->action(); } } - + doRope(e); - + restrictToBattleArea(e); - + if (!e->speed) { e->dx = e->dy = 0; } - + e->x += e->dx; e->y += e->dy; - - if (!isComponent(e)) - { - addToQuadtree(e, &battle.quadtree); - } + + addToQuadtree(e, &battle.quadtree); } else { @@ -332,6 +329,8 @@ static void alignComponents(void) { if (isComponent(e)) { + removeFromQuadtree(e, &battle.quadtree); + s = sin(TO_RAIDANS(e->owner->angle)); c = cos(TO_RAIDANS(e->owner->angle));