History

resolve conflicts on merge with upstream/master

Stephen Birarda committed 10 years ago

Commit 4573e5c2 parents a7dfc99 85b8266325 files · +10929 −5218Browse files

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

Unified · Split

libraries/entities/src/EntityScriptingInterface.cpp+16−12
@@ -611,7 +611,8 @@ QUuid EntityScriptingInterface::addAction(const QString& actionTypeString, · 610 unmodified lines
611611 const QVariantMap& arguments) {
612612 QUuid actionID = QUuid::createUuid();
613613 auto actionFactory = DependencyManager::get<EntityActionFactoryInterface>();
614− bool success = actionWorker(entityID, [&](EntitySimulation* simulation, EntityItemPointer entity) {
614+ bool success = false;
615+ actionWorker(entityID, [&](EntitySimulation* simulation, EntityItemPointer entity) {
615616 // create this action even if the entity doesn't have physics info. it will often be the
616617 // case that a script adds an action immediately after an object is created, and the physicsInfo
617618 // is computed asynchronously.
@@ -623,16 +624,16 @@ QUuid EntityScriptingInterface::addAction(const QString& actionTypeString, · 5 unmodified lines
623624 return false;
624625 }
625626 EntityActionPointer action = actionFactory->factory(actionType, actionID, entity, arguments);
626− if (action) {
627− entity->addAction(simulation, action);
628− auto nodeList = DependencyManager::get<NodeList>();
629− const QUuid myNodeID = nodeList->getSessionUUID();
630− if (entity->getSimulatorID() != myNodeID) {
631− entity->flagForOwnership();
632− }
633− return true;
627+ if (!action) {
628+ return false;
629+ }
630+ success = entity->addAction(simulation, action);
631+ auto nodeList = DependencyManager::get<NodeList>();
632+ const QUuid myNodeID = nodeList->getSessionUUID();
633+ if (entity->getSimulatorID() != myNodeID) {
634+ entity->flagForOwnership();
634635 }
635− return false;
636+ return false; // Physics will cause a packet to be sent, so don't send from here.
636637 });
637638 if (success) {
638639 return actionID;
@@ -656,9 +657,12 @@ bool EntityScriptingInterface::updateAction(const QUuid& entityID, const QUuid& · 17 unmodified lines
656657 }
657658
658659 bool EntityScriptingInterface::deleteAction(const QUuid& entityID, const QUuid& actionID) {
659− return actionWorker(entityID, [&](EntitySimulation* simulation, EntityItemPointer entity) {
660− return entity->removeAction(simulation, actionID);
660+ bool success = false;
661+ actionWorker(entityID, [&](EntitySimulation* simulation, EntityItemPointer entity) {
662+ success = entity->removeAction(simulation, actionID);
663+ return false; // Physics will cause a packet to be sent, so don't send from here.
661664 });
665+ return success;
662666 }
663667
664668 QVector<QUuid> EntityScriptingInterface::getActionIDs(const QUuid& entityID) {