diff --git a/CHANGELOG.md b/CHANGELOG.md index a448efe..a89ee3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Fixed +- Remove entity from engine if exist ## [2.0.1] - 2022-11-08 ### Fixed diff --git a/src/placement.ts b/src/placement.ts index e475e64..fd2e21e 100644 --- a/src/placement.ts +++ b/src/placement.ts @@ -196,7 +196,9 @@ export class PlainPlacement extends Entity implements IPlacement { public reset(): void { for (let k in this.children) { - engine.removeEntity(this.children[k]) + if(this.children[k].isAddedToEngine()){ + engine.removeEntity(this.children[k]) + } delete this.children[k] } }