set last-edited in properties when changing voxel data

This commit is contained in:
Seth Alves 2015-05-26 21:32:33 -07:00
parent 5acc018bda
commit 6b5020285b
2 changed files with 7 additions and 7 deletions

View file

@ -37,11 +37,11 @@ void EntityEditPacketSender::queueEditEntityMessage(PacketType type, EntityItemI
int sizeOut = 0;
if (EntityItemProperties::encodeEntityEditPacket(type, modelID, properties, &bufferOut[0], _maxPacketSize, sizeOut)) {
#ifdef WANT_DEBUG
//#ifdef WANT_DEBUG
qCDebug(entities) << "calling queueOctreeEditMessage()...";
qCDebug(entities) << " id:" << modelID;
qCDebug(entities) << " properties:" << properties;
#endif
//#endif
queueOctreeEditMessage(type, bufferOut, sizeOut);
}
}

View file

@ -399,10 +399,13 @@ bool EntityScriptingInterface::setVoxelSphere(QUuid entityID, const glm::vec3& c
return false;
}
auto now = usecTimestampNow();
PolyVoxEntityItem* polyVoxEntity = static_cast<PolyVoxEntityItem*>(entity);
_entityTree->lockForWrite();
polyVoxEntity->setSphere(center, radius, value);
// entity->setLastEdited(usecTimestampNow());
entity->setLastEdited(now);
entity->setLastBroadcast(now);
_entityTree->unlock();
_entityTree->lockForRead();
@ -410,10 +413,7 @@ bool EntityScriptingInterface::setVoxelSphere(QUuid entityID, const glm::vec3& c
_entityTree->unlock();
properties.setVoxelDataDirty();
entity->setLastBroadcast(usecTimestampNow());
// modifiedProperties.setType(entity->getType());
// bidForSimulationOwnership(modifiedProperties);
properties.setLastEdited(now);
queueEntityMessage(PacketTypeEntityEdit, entityID, properties);
return true;