diff --git a/app/ecs-systems/calculate-aabbs.js b/app/ecs-systems/calculate-aabbs.js index f4fef6e..348b054 100644 --- a/app/ecs-systems/calculate-aabbs.js +++ b/app/ecs-systems/calculate-aabbs.js @@ -12,7 +12,7 @@ export default class CalculateAabbs extends System { const {diff} = this.ecs; for (const id in diff) { if (diff[id].Position) { - const {Position: {x, y}, VisibleAabb} = this.ecs.get(parseInt(id)) + const {Position: {x, y}, VisibleAabb} = this.ecs.get(id); if (VisibleAabb) { VisibleAabb.x0 = x - 32; VisibleAabb.x1 = x + 32; diff --git a/app/ecs-systems/follow-camera.js b/app/ecs-systems/follow-camera.js index a53b7f6..68725c1 100644 --- a/app/ecs-systems/follow-camera.js +++ b/app/ecs-systems/follow-camera.js @@ -12,7 +12,7 @@ export default class FollowCamera extends System { reindex(entities) { super.reindex(entities); for (const id of entities) { - this.updateCamera(this.ecs.get(parseInt(id))); + this.updateCamera(this.ecs.get(id)); } } @@ -20,7 +20,7 @@ export default class FollowCamera extends System { const {diff} = this.ecs; for (const id in diff) { if (diff[id].Position) { - this.updateCamera(this.ecs.get(parseInt(id))); + this.updateCamera(this.ecs.get(id)); } } } diff --git a/app/ecs-systems/update-spatial-hash.js b/app/ecs-systems/update-spatial-hash.js index 543f1f8..6a96a59 100644 --- a/app/ecs-systems/update-spatial-hash.js +++ b/app/ecs-systems/update-spatial-hash.js @@ -85,7 +85,7 @@ export default class UpdateSpatialHash extends System { const {diff} = this.ecs; for (const id in diff) { if (diff[id].VisibleAabb) { - this.updateHash(this.ecs.get(parseInt(id))); + this.updateHash(this.ecs.get(id)); } } } diff --git a/app/react-components/ecs.jsx b/app/react-components/ecs.jsx index fc01f9e..6d4b350 100644 --- a/app/react-components/ecs.jsx +++ b/app/react-components/ecs.jsx @@ -20,9 +20,9 @@ export default function EcsComponent() { delete updatedEntities[id]; } else { - updatedEntities[id] = ecs.get(parseInt(id)); + updatedEntities[id] = ecs.get(id); if (updatedEntities[id].MainEntity) { - setMainEntity(ecs.get(parseInt(id))); + setMainEntity(ecs.get(id)); } } }