Always add ents to quadtree, to allow AI to see components. Shuffle around later.
This commit is contained in:
parent
5e58f09fcf
commit
b40936fd79
|
@ -161,11 +161,8 @@ void doEntities(void)
|
||||||
e->x += e->dx;
|
e->x += e->dx;
|
||||||
e->y += e->dy;
|
e->y += e->dy;
|
||||||
|
|
||||||
if (!isComponent(e))
|
|
||||||
{
|
|
||||||
addToQuadtree(e, &battle.quadtree);
|
addToQuadtree(e, &battle.quadtree);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (e == battle.entityTail)
|
if (e == battle.entityTail)
|
||||||
|
@ -332,6 +329,8 @@ static void alignComponents(void)
|
||||||
{
|
{
|
||||||
if (isComponent(e))
|
if (isComponent(e))
|
||||||
{
|
{
|
||||||
|
removeFromQuadtree(e, &battle.quadtree);
|
||||||
|
|
||||||
s = sin(TO_RAIDANS(e->owner->angle));
|
s = sin(TO_RAIDANS(e->owner->angle));
|
||||||
c = cos(TO_RAIDANS(e->owner->angle));
|
c = cos(TO_RAIDANS(e->owner->angle));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue