refactor: room.findEntity

This commit is contained in:
cha0s 2019-03-27 17:37:09 -05:00
parent 209010f7ab
commit 5a803a79e2

View File

@ -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;
}
}