Process entities only if they are active and not removed

This commit is contained in:
Matt Low 2020-01-27 18:35:55 +04:00
parent 042282646b
commit 01c6a777cb

View File

@ -27,8 +27,11 @@ public abstract class EntitySystem extends BaseSystem {
} }
public void process(float dt) { public void process(float dt) {
for (int i = 0, n = getEntities().size; i < n; i++) { for (int i = 0, n = entities.size; i < n; i++) {
processEntity(entities.get(i), dt); Entity entity = entities.items[i];
if (!entity.removed && entity.active) {
processEntity(entity, dt);
}
} }
} }