Skip to content

Commit

Permalink
Merge pull request #6 from adshares/fix_removing_from_engine
Browse files Browse the repository at this point in the history
Fix removing from engine
  • Loading branch information
m-pilarczyk authored Mar 7, 2023
2 parents 3fc3455 + e528103 commit 5567aca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion src/placement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
}
Expand Down

0 comments on commit 5567aca

Please sign in to comment.