mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 18:23:54 +02:00
Update getEntityItemID() to check for id existence
This commit is contained in:
parent
0242e0efcf
commit
a18a83d45c
1 changed files with 11 additions and 1 deletions
|
@ -45,7 +45,17 @@ EntityItemID EntityScriptingInterface::addEntity(const EntityItemProperties& pro
|
|||
}
|
||||
|
||||
EntityItemID EntityScriptingInterface::getEntityItemID(const QString& uuid) {
|
||||
return EntityItemID(QUuid(uuid));
|
||||
EntityItemID entityID = EntityItemID(QUuid(uuid), UNKNOWN_ENTITY_TOKEN, false);
|
||||
|
||||
_entityTree->lockForRead();
|
||||
EntityItem* entity = const_cast<EntityItem*>(_entityTree->findEntityByEntityItemID(entityID));
|
||||
_entityTree->unlock();
|
||||
|
||||
if (entity) {
|
||||
return entity->getEntityItemID();
|
||||
}
|
||||
|
||||
return entityID;
|
||||
}
|
||||
|
||||
EntityItemID EntityScriptingInterface::identifyEntity(EntityItemID entityID) {
|
||||
|
|
Loading…
Reference in a new issue