diff --git a/libraries/entities/src/ModelEntityItem.cpp b/libraries/entities/src/ModelEntityItem.cpp index 109491d90d..d4cda49a21 100644 --- a/libraries/entities/src/ModelEntityItem.cpp +++ b/libraries/entities/src/ModelEntityItem.cpp @@ -221,11 +221,15 @@ int ModelEntityItem::oldVersionReadEntityDataFromBuffer(const unsigned char* dat const unsigned char* dataAt = data; // id - // TODO: this is where we should handle reading old style IDs and converting them into UUIDs... maybe we just discard them - // and create the new ID from that... - memcpy(&_id, dataAt, sizeof(_id)); - dataAt += sizeof(_id); - bytesRead += sizeof(_id); + // this old bitstream format had 32bit IDs. They are obsolete and need to be replaced with our new UUID + // format. We can simply read and ignore the old ID since they should not be repeated. This code should only + // run on loading from an old file. + quint32 oldID; + memcpy(&oldID, dataAt, sizeof(oldID)); + dataAt += sizeof(oldID); + bytesRead += sizeof(oldID); + _id = QUuid::createUuid(); + //qDebug() << "ModelEntityItem::oldVersionReadEntityDataFromBuffer()... oldID=" << oldID << "new _id=" << _id; // _lastUpdated memcpy(&_lastUpdated, dataAt, sizeof(_lastUpdated)); diff --git a/libraries/entities/src/todo.txt b/libraries/entities/src/todo.txt index 47758f439c..fb851038c7 100644 --- a/libraries/entities/src/todo.txt +++ b/libraries/entities/src/todo.txt @@ -43,7 +43,7 @@ Model properties: DONE -- 22e) void ModelTreeElement::getModelsInside(const AACube& box, QVector& foundModels)... - 2) verify shadows work + 1) random crashes on moving (I think things going out of bounds???) @@ -63,7 +63,6 @@ Model properties: 8) EntityTreeRenderer::clearModelsCache() - 9) Handle the ID -> UUID swap in old files to new files 10) Test models -> attachments logic @@ -257,4 +256,7 @@ Model properties: // Sit somewhere // Move model with another avatar. // Observe first avatar moving. - +// SOLVED -- 2) verify shadows work +// SOLVED -- 9) Handle the ID -> UUID swap in old files to new files - verify old files read correctly + +