History

Merge pull request #15201 from SamGondelman/emit

Case 21756: Entities.emitScriptEvent works now

Sam Gondelman committed 7 years ago

Commit 40f5a022 parents 385970c d4e1ec98 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
@@ -2196,14 +2196,7 @@ bool EntityScriptingInterface::wantsHandControllerPointerEvents(const QUuid& id) · 2195 unmodified lines
2196}2196}
2197 2197
2198void EntityScriptingInterface::emitScriptEvent(const EntityItemID& entityID, const QVariant& message) {2198void EntityScriptingInterface::emitScriptEvent(const EntityItemID& entityID, const QVariant& message) {
2199 if (_entityTree) {2199 EntityTree::emitScriptEvent(entityID, message);
2200 _entityTree->withReadLock([&] {
2201 EntityItemPointer entity = _entityTree->findEntityByEntityItemID(EntityItemID(entityID));
2202 if (entity) {
2203 entity->emitScriptEvent(message);
2204 }
2205 });
2206 }
2207}2200}
2208 2201
2209// TODO move this someplace that makes more sense...2202// TODO move this someplace that makes more sense...