fix: don't create entities if they already exist
This commit is contained in:
parent
2747542932
commit
769338a946
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user