refactor: room.findEntity
This commit is contained in:
parent
209010f7ab
commit
5a803a79e2
|
@ -26,10 +26,7 @@ function hasSelfEntity() {
|
|||
room.on('entityAdded', (entity) => {
|
||||
// Set self entity.
|
||||
if ('string' === typeof selfEntity) {
|
||||
const layer = room.layer('everything');
|
||||
const entityList = layer.entityList;
|
||||
const mappedUuid = entityList.mappedUuid(selfEntity);
|
||||
if (entity.instanceUuid === mappedUuid) {
|
||||
if (entity === room.findEntity(selfEntity)) {
|
||||
selfEntity = entity;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user