Process entities only if they are active and not removed
This commit is contained in:
@ -27,8 +27,11 @@ public abstract class EntitySystem extends BaseSystem {
|
||||
}
|
||||
|
||||
public void process(float dt) {
|
||||
for (int i = 0, n = getEntities().size; i < n; i++) {
|
||||
processEntity(entities.get(i), dt);
|
||||
for (int i = 0, n = entities.size; i < n; i++) {
|
||||
Entity entity = entities.items[i];
|
||||
if (!entity.removed && entity.active) {
|
||||
processEntity(entity, dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user