From 769338a946cc304b4a5bdbe987f6a55ed5c93e68 Mon Sep 17 00:00:00 2001 From: cha0s Date: Thu, 16 May 2019 15:46:49 -0500 Subject: [PATCH] fix: don't create entities if they already exist --- packages/entity/list/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/entity/list/index.js b/packages/entity/list/index.js index cb5252d..f89b76e 100644 --- a/packages/entity/list/index.js +++ b/packages/entity/list/index.js @@ -33,9 +33,11 @@ export class EntityList extends decorate(class {}) { acceptPacket(packet) { if (packet instanceof EntityCreatePacket) { - const entity = new Entity(packet.data); - entity.instanceUuid = packet.data.uuid; - this.addEntity(entity); + if (!this.findEntity(packet.data.uuid)) { + const entity = new Entity(packet.data); + entity.instanceUuid = packet.data.uuid; + this.addEntity(entity); + } } }