fix: index only active

This commit is contained in:
cha0s 2024-07-23 17:03:53 -05:00
parent c27ab133a9
commit 5a92be47c1

View File

@ -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);
}
}