diff --git a/app/ecs/ecs.js b/app/ecs/ecs.js index 8a47672..7485a94 100644 --- a/app/ecs/ecs.js +++ b/app/ecs/ecs.js @@ -178,7 +178,11 @@ export default class Ecs { deindex(entityIds) { for (const systemName in this.Systems) { - this.Systems[systemName].deindex(entityIds); + const System = this.Systems[systemName]; + if (!System.active) { + continue; + } + System.deindex(entityIds); } } @@ -384,7 +388,11 @@ export default class Ecs { reindex(entityIds) { for (const systemName in this.Systems) { - this.Systems[systemName].reindex(entityIds); + const System = this.Systems[systemName]; + if (!System.active) { + continue; + } + System.reindex(entityIds); } }