From 4d3b2f10a1dd17ce9435be9374cd51d42bea4cbd Mon Sep 17 00:00:00 2001 From: Steve Date: Sun, 21 Feb 2016 09:41:00 +0000 Subject: [PATCH] Remove entities from quadtree at start of loop. --- src/battle/entities.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/battle/entities.c b/src/battle/entities.c index e868ef5..ad3d7c2 100644 --- a/src/battle/entities.c +++ b/src/battle/entities.c @@ -69,11 +69,6 @@ void doEntities(void) numAllies = numEnemies = numActiveAllies = numActiveEnemies = 0; - for (e = battle.entityHead.next ; e != NULL ; e = e->next) - { - removeFromQuadtree(e, &battle.quadtree); - } - if (dev.playerImmortal) { player->health = player->maxHealth; @@ -82,6 +77,8 @@ void doEntities(void) for (e = battle.entityHead.next ; e != NULL ; e = e->next) { + removeFromQuadtree(e, &battle.quadtree); + if (dev.allImmortal) { e->health = e->maxHealth;