History

adjust how EntityMotionState updates its idea of what the server knows about an entity

Seth Alves committed 11 years ago

Commit 82bd5061 parent 5e4f30b2 files · +15 −11Browse files

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

Unified · Split

libraries/entities/src/EntityScriptingInterface.cpp+10−11
@@ -611,7 +611,7 @@ 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 = true;
614+ bool success = false;
615615 actionWorker(entityID, [&](EntitySimulation* simulation, EntityItemPointer entity) {
616616 // create this action even if the entity doesn't have physics info. it will often be the
617617 // case that a script adds an action immediately after an object is created, and the physicsInfo
@@ -621,20 +621,19 @@ QUuid EntityScriptingInterface::addAction(const QString& actionTypeString, · 3 unmodified lines
621621 // }
622622 EntityActionType actionType = EntityActionInterface::actionTypeFromString(actionTypeString);
623623 if (actionType == ACTION_TYPE_NONE) {
624− success = false;
625624 return false;
626625 }
627626 EntityActionPointer action = actionFactory->factory(actionType, actionID, entity, arguments);
628− if (action) {
629− success = entity->addAction(simulation, action);
630− auto nodeList = DependencyManager::get<NodeList>();
631− const QUuid myNodeID = nodeList->getSessionUUID();
632− if (entity->getSimulatorID() != myNodeID) {
633− entity->flagForOwnership();
634− }
635− return false; // Physics will cause a packet to be sent, so don't send from here.
627+ if (!action) {
628+ return false;
636629 }
637− return false;
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();
635+ }
636+ return false; // Physics will cause a packet to be sent, so don't send from here.
638637 });
639638 if (success) {
640639 return actionID;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t