CR feedback

This commit is contained in:
Thijs Wenker 2018-05-21 06:04:05 +02:00
parent 70bbac5c83
commit f4df75d016
2 changed files with 5 additions and 8 deletions

View file

@ -293,8 +293,7 @@ bool EntityScriptingInterface::addLocalEntityCopy(EntityItemProperties& properti
// since we're creating this object we will immediately volunteer to own its simulation // since we're creating this object we will immediately volunteer to own its simulation
entity->flagForOwnershipBid(VOLUNTEER_SIMULATION_PRIORITY); entity->flagForOwnershipBid(VOLUNTEER_SIMULATION_PRIORITY);
properties.setLastEdited(entity->getLastEdited()); properties.setLastEdited(entity->getLastEdited());
} } else {
else {
qCDebug(entities) << "script failed to add new Entity to local Octree"; qCDebug(entities) << "script failed to add new Entity to local Octree";
success = false; success = false;
} }

View file

@ -1428,8 +1428,8 @@ int EntityTree::processEditPacketData(ReceivedMessage& message, const unsigned c
case PacketType::EntityClone: case PacketType::EntityClone:
isClone = true; // fall through to next case isClone = true; // fall through to next case
case PacketType::EntityAdd:
// FALLTHRU // FALLTHRU
case PacketType::EntityAdd:
isAdd = true; // fall through to next case isAdd = true; // fall through to next case
// FALLTHRU // FALLTHRU
case PacketType::EntityPhysics: case PacketType::EntityPhysics:
@ -2490,12 +2490,10 @@ bool EntityTree::readFromMap(QVariantMap& map) {
} }
} }
for (auto iter = cloneIDs.begin(); iter != cloneIDs.end(); ++iter) { for (const auto& entityID : cloneIDs.keys()) {
const QUuid& entityID = iter.key(); auto entity = findEntityByID(entityID);
const QVector<QUuid>& cloneIDs = iter.value();
EntityItemPointer entity = findEntityByID(entityID);
if (entity) { if (entity) {
entity->setCloneIDs(cloneIDs); entity->setCloneIDs(cloneIDs.value(entityID));
} }
} }