@dcl/ecs 7.20.5-22638863063.commit-f988f31 → 7.20.5-22639691829.commit-b96024f

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -61,8 +61,10 @@ export var EntityState;
61
61
  */
62
62
  export function createEntityContainer(opts) {
63
63
  const reservedStaticEntities = opts?.reservedStaticEntities ?? RESERVED_STATIC_ENTITIES;
64
- // Local entities counter
65
- let entityCounter = reservedStaticEntities;
64
+ // If a build tool has set DCL_MAX_COMPOSITE_ENTITY (via esbuild define),
65
+ // start the counter past composite entities to prevent ID collisions.
66
+ const maxCompositeEntity = typeof DCL_MAX_COMPOSITE_ENTITY !== 'undefined' ? DCL_MAX_COMPOSITE_ENTITY : 0;
67
+ let entityCounter = Math.max(reservedStaticEntities, maxCompositeEntity > 0 ? maxCompositeEntity + 1 : 0);
66
68
  const usedEntities = new Set();
67
69
  let toRemoveEntities = [];
68
70
  const removedEntities = createVersionGSet();
@@ -64,8 +64,10 @@ var EntityState;
64
64
  */
65
65
  function createEntityContainer(opts) {
66
66
  const reservedStaticEntities = opts?.reservedStaticEntities ?? exports.RESERVED_STATIC_ENTITIES;
67
- // Local entities counter
68
- let entityCounter = reservedStaticEntities;
67
+ // If a build tool has set DCL_MAX_COMPOSITE_ENTITY (via esbuild define),
68
+ // start the counter past composite entities to prevent ID collisions.
69
+ const maxCompositeEntity = typeof DCL_MAX_COMPOSITE_ENTITY !== 'undefined' ? DCL_MAX_COMPOSITE_ENTITY : 0;
70
+ let entityCounter = Math.max(reservedStaticEntities, maxCompositeEntity > 0 ? maxCompositeEntity + 1 : 0);
69
71
  const usedEntities = new Set();
70
72
  let toRemoveEntities = [];
71
73
  const removedEntities = (0, gset_1.createVersionGSet)();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dcl/ecs",
3
3
  "description": "Decentraland ECS",
4
- "version": "7.20.5-22638863063.commit-f988f31",
4
+ "version": "7.20.5-22639691829.commit-b96024f",
5
5
  "author": "DCL",
6
6
  "bugs": "https://github.com/decentraland/ecs/issues",
7
7
  "files": [
@@ -33,5 +33,5 @@
33
33
  },
34
34
  "types": "./dist/index.d.ts",
35
35
  "typings": "./dist/index.d.ts",
36
- "commit": "f988f317ab5b7a53fbbbf0e6f777b31f64f67ea4"
36
+ "commit": "b96024f79a33b41243cad450a1e019239c0e4386"
37
37
  }