Case 21756: Entities.emitScriptEvent works now
Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 8 files). Show all
Unified · Split
| @@ -2196,14 +2196,7 @@ bool EntityScriptingInterface::wantsHandControllerPointerEvents(const QUuid& id) · 2195 unmodified lines | ||
| 2196 | 2196 | } |
| 2197 | 2197 | |
| 2198 | 2198 | void EntityScriptingInterface::emitScriptEvent(const EntityItemID& entityID, const QVariant& message) { |
| 2199 | − if (_entityTree) { | |
| 2200 | − _entityTree->withReadLock([&] { | |
| 2201 | − EntityItemPointer entity = _entityTree->findEntityByEntityItemID(EntityItemID(entityID)); | |
| 2202 | − if (entity) { | |
| 2203 | − entity->emitScriptEvent(message); | |
| 2204 | − } | |
| 2205 | − }); | |
| 2206 | − } | |
| 2199 | + EntityTree::emitScriptEvent(entityID, message); | |
| 2207 | 2200 | } |
| 2208 | 2201 | |
| 2209 | 2202 | // TODO move this someplace that makes more sense... |