History

fix emitScriptEvent

SamGondelman committed 7 years ago

Commit d4e1ec91 parent 98eec6b8 files · +21 −12Browse files

Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 8 files). Show all

Unified · Split

libraries/entities/src/EntityScriptingInterface.cpp+1−8
@@ -2202,14 +2202,7 @@ bool EntityScriptingInterface::wantsHandControllerPointerEvents(const QUuid& id) · 2201 unmodified lines
2202}2202}
2203 2203
2204void EntityScriptingInterface::emitScriptEvent(const EntityItemID& entityID, const QVariant& message) {2204void EntityScriptingInterface::emitScriptEvent(const EntityItemID& entityID, const QVariant& message) {
2205 if (_entityTree) {2205 EntityTree::emitScriptEvent(entityID, message);
2206 _entityTree->withReadLock([&] {
2207 EntityItemPointer entity = _entityTree->findEntityByEntityItemID(EntityItemID(entityID));
2208 if (entity) {
2209 entity->emitScriptEvent(message);
2210 }
2211 });
2212 }
2213}2206}
2214 2207
2215// TODO move this someplace that makes more sense...2208// TODO move this someplace that makes more sense...