fix: don't double-add entities
This commit is contained in:
parent
3197525f03
commit
38a907d9bb
|
@ -44,6 +44,10 @@ export class EntityList extends decorate(class {}) {
|
||||||
|
|
||||||
addEntity(entity) {
|
addEntity(entity) {
|
||||||
const uuid = entity.instanceUuid;
|
const uuid = entity.instanceUuid;
|
||||||
|
// Already exists?
|
||||||
|
if (this._entities[uuid]) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
this._entities[uuid] = entity;
|
this._entities[uuid] = entity;
|
||||||
this._flatEntities.push(entity);
|
this._flatEntities.push(entity);
|
||||||
this._entityTickers.push(entity.tick);
|
this._entityTickers.push(entity.tick);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user