Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 5 files). Show all
Unified · Split
| @@ -1017,14 +1017,7 @@ QString EntityScriptingInterface::getEntityType(const QUuid& entityID) { · 1016 unmodified lines | |||
| 1017 | } | 1017 | } |
| 1018 | 1018 | ||
| 1019 | QObject* EntityScriptingInterface::getEntityObject(const QUuid& id) { | 1019 | QObject* EntityScriptingInterface::getEntityObject(const QUuid& id) { |
| 1020 | QObject* toReturn { nullptr }; | 1020 | return EntityTree::getEntityObject(id); |
| 1021 | _entityTree->withReadLock([&] { | ||
| 1022 | EntityItemPointer entity = _entityTree->findEntityByEntityItemID(id); | ||
| 1023 | if (entity) { | ||
| 1024 | toReturn = qobject_cast<QObject*>(&(*entity)); | ||
| 1025 | } | ||
| 1026 | }); | ||
| 1027 | return toReturn; | ||
| 1028 | } | 1021 | } |
| 1029 | 1022 | ||
| 1030 | bool EntityScriptingInterface::isLoaded(const QUuid& id) { | 1023 | bool EntityScriptingInterface::isLoaded(const QUuid& id) { |