fix: don't create entities if they already exist

This commit is contained in:
cha0s 2019-05-16 15:46:49 -05:00
parent 2747542932
commit 769338a946

View File

@ -33,11 +33,13 @@ export class EntityList extends decorate(class {}) {
acceptPacket(packet) {
if (packet instanceof EntityCreatePacket) {
if (!this.findEntity(packet.data.uuid)) {
const entity = new Entity(packet.data);
entity.instanceUuid = packet.data.uuid;
this.addEntity(entity);
}
}
}
addEntity(entity) {
const uuid = entity.instanceUuid;