From 38a907d9bbec7ecbb63f76b1ec417fbf1354b6d2 Mon Sep 17 00:00:00 2001 From: cha0s Date: Wed, 5 Jun 2019 20:16:51 -0500 Subject: [PATCH] fix: don't double-add entities --- packages/entity/list/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/entity/list/index.js b/packages/entity/list/index.js index abcc975..c1ff277 100644 --- a/packages/entity/list/index.js +++ b/packages/entity/list/index.js @@ -44,6 +44,10 @@ export class EntityList extends decorate(class {}) { addEntity(entity) { const uuid = entity.instanceUuid; + // Already exists? + if (this._entities[uuid]) { + return; + } this._entities[uuid] = entity; this._flatEntities.push(entity); this._entityTickers.push(entity.tick);