From 993111d22f6249b788c4ca37f51dce9ca85d63ee Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Mon, 5 Oct 2015 11:28:59 -0700 Subject: [PATCH] code review --- interface/src/InterfaceActionFactory.cpp | 6 +++--- libraries/entities/src/EntityItem.cpp | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/interface/src/InterfaceActionFactory.cpp b/interface/src/InterfaceActionFactory.cpp index 2879c19eaa..cf5dad8fa5 100644 --- a/interface/src/InterfaceActionFactory.cpp +++ b/interface/src/InterfaceActionFactory.cpp @@ -65,9 +65,9 @@ EntityActionPointer InterfaceActionFactory::factoryBA(EntityItemPointer ownerEnt if (action) { action->deserialize(data); - } - if (action->lifetimeIsOver()) { - return nullptr; + if (action->lifetimeIsOver()) { + return nullptr; + } } return action; diff --git a/libraries/entities/src/EntityItem.cpp b/libraries/entities/src/EntityItem.cpp index a031fbb196..c4f5ad0061 100644 --- a/libraries/entities/src/EntityItem.cpp +++ b/libraries/entities/src/EntityItem.cpp @@ -1661,13 +1661,14 @@ void EntityItem::deserializeActionsInternal() { // TODO: make sure types match? there isn't currently a way to // change the type of an existing action. action->deserialize(serializedAction); + action->locallyAddedButNotYetReceived = false; } else { auto actionFactory = DependencyManager::get(); EntityItemPointer entity = shared_from_this(); EntityActionPointer action = actionFactory->factoryBA(entity, serializedAction); if (action) { - action->locallyAddedButNotYetReceived = false; entity->addActionInternal(simulation, action); + action->locallyAddedButNotYetReceived = false; } } }