mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 07:17:43 +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) {
|
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) {
|
EntityItemID EntityScriptingInterface::identifyEntity(EntityItemID entityID) {
|
||||||
|
|
Loading…
Reference in a new issue