mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
Fix entity list selection failing when selecting entities not in list
This commit is contained in:
parent
3b1e0dc7d9
commit
72adfb7ff0
1 changed files with 10 additions and 4 deletions
|
@ -161,7 +161,10 @@ function loaded() {
|
|||
|
||||
selectedEntities.forEach(function(entityID) {
|
||||
if (selection.indexOf(entityID) === -1) {
|
||||
entitiesByID[entityID].el.className = '';
|
||||
let entity = entitiesByID[entityID];
|
||||
if (entity !== undefined) {
|
||||
entity.el.className = '';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -385,15 +388,18 @@ function loaded() {
|
|||
let notFound = false;
|
||||
|
||||
selectedEntities.forEach(function(id) {
|
||||
entitiesByID[id].el.className = '';
|
||||
let entity = entitiesByID[id];
|
||||
if (entity !== undefined) {
|
||||
entity.el.className = '';
|
||||
}
|
||||
});
|
||||
|
||||
selectedEntities = [];
|
||||
for (let i = 0; i < selectedIDs.length; i++) {
|
||||
let id = selectedIDs[i];
|
||||
selectedEntities.push(id);
|
||||
if (id in entitiesByID) {
|
||||
let entity = entitiesByID[id];
|
||||
let entity = entitiesByID[id];
|
||||
if (entity !== undefined) {
|
||||
entity.el.className = 'selected';
|
||||
} else {
|
||||
notFound = true;
|
||||
|
|
Loading…
Reference in a new issue