mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 18:23:54 +02:00
Fix the crash
This commit is contained in:
parent
c570d483d8
commit
07a4beac73
1 changed files with 16 additions and 8 deletions
|
@ -257,15 +257,23 @@ void ContextOverlayInterface::openMarketplace() {
|
|||
}
|
||||
|
||||
void ContextOverlayInterface::enableEntityHighlight(const EntityItemID& entityItemID) {
|
||||
if (!qApp->getEntities()->getTree()->findEntityByEntityItemID(entityItemID)->getShouldHighlight()) {
|
||||
qCDebug(context_overlay) << "Setting 'shouldHighlight' to 'true' for Entity ID:" << entityItemID;
|
||||
qApp->getEntities()->getTree()->findEntityByEntityItemID(entityItemID)->setShouldHighlight(true);
|
||||
}
|
||||
auto entityTree = qApp->getEntities()->getTree();
|
||||
entityTree->withReadLock([&] {
|
||||
auto entityItem = entityTree->findEntityByEntityItemID(entityItemID);
|
||||
if ((entityItem != NULL) && !entityItem->getShouldHighlight()) {
|
||||
qCDebug(context_overlay) << "Setting 'shouldHighlight' to 'true' for Entity ID:" << entityItemID;
|
||||
entityItem->setShouldHighlight(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void ContextOverlayInterface::disableEntityHighlight(const EntityItemID& entityItemID) {
|
||||
if (qApp->getEntities()->getTree()->findEntityByEntityItemID(entityItemID)->getShouldHighlight()) {
|
||||
qCDebug(context_overlay) << "Setting 'shouldHighlight' to 'false' for Entity ID:" << entityItemID;
|
||||
qApp->getEntities()->getTree()->findEntityByEntityItemID(entityItemID)->setShouldHighlight(false);
|
||||
}
|
||||
auto entityTree = qApp->getEntities()->getTree();
|
||||
entityTree->withReadLock([&] {
|
||||
auto entityItem = entityTree->findEntityByEntityItemID(entityItemID);
|
||||
if ((entityItem != NULL) && entityItem->getShouldHighlight()) {
|
||||
qCDebug(context_overlay) << "Setting 'shouldHighlight' to 'false' for Entity ID:" << entityItemID;
|
||||
entityItem->setShouldHighlight(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue