don't send AVATAR_SELF_ID over wire

This commit is contained in:
Seth Alves 2017-02-03 14:05:23 -08:00
parent 1ddafa3cee
commit 37de4aefa6

View file

@ -100,7 +100,18 @@ void EntityEditPacketSender::queueEditEntityMessage(PacketType type,
QByteArray bufferOut(NLPacket::maxPayloadSize(type), 0);
if (EntityItemProperties::encodeEntityEditPacket(type, entityItemID, properties, bufferOut)) {
bool success;
if (properties.parentIDChanged() && properties.getParentID() == AVATAR_SELF_ID) {
EntityItemProperties propertiesCopy = properties;
auto nodeList = DependencyManager::get<NodeList>();
const QUuid myNodeID = nodeList->getSessionUUID();
propertiesCopy.setParentID(myNodeID);
success = EntityItemProperties::encodeEntityEditPacket(type, entityItemID, propertiesCopy, bufferOut);
} else {
success = EntityItemProperties::encodeEntityEditPacket(type, entityItemID, properties, bufferOut);
}
if (success) {
#ifdef WANT_DEBUG
qCDebug(entities) << "calling queueOctreeEditMessage()...";
qCDebug(entities) << " id:" << entityItemID;