mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 19:34:23 +02:00
fix READ_ENTITY_PROPERTY_UUID_TO_PROPERTIES to use binary version
This commit is contained in:
parent
3b2a15f76a
commit
1484d6e37f
2 changed files with 4 additions and 3 deletions
libraries/entities/src
|
@ -798,7 +798,7 @@ bool EntityItemProperties::decodeEntityEditPacket(const unsigned char* data, int
|
|||
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_COLLISIONS_WILL_MOVE, bool, setCollisionsWillMove);
|
||||
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_LOCKED, bool, setLocked);
|
||||
READ_ENTITY_PROPERTY_STRING_TO_PROPERTIES(PROP_USER_DATA, setUserData);
|
||||
READ_ENTITY_PROPERTY_STRING_TO_PROPERTIES(PROP_SIMULATOR_ID, setSimulatorID);
|
||||
READ_ENTITY_PROPERTY_UUID_TO_PROPERTIES(PROP_SIMULATOR_ID, setSimulatorID);
|
||||
|
||||
if (properties.getType() == EntityTypes::Text) {
|
||||
READ_ENTITY_PROPERTY_STRING_TO_PROPERTIES(PROP_TEXT, setText);
|
||||
|
|
|
@ -145,14 +145,15 @@
|
|||
}
|
||||
|
||||
|
||||
// TODO: make a version of this that does a binary unpacking of the uuid
|
||||
// TODO: this doesn't need a length. See OctreePacketData::appendValue(const QUuid& uuid)
|
||||
#define READ_ENTITY_PROPERTY_UUID_TO_PROPERTIES(P,O) \
|
||||
if (propertyFlags.getHasProperty(P)) { \
|
||||
uint16_t length; \
|
||||
memcpy(&length, dataAt, sizeof(length)); \
|
||||
dataAt += sizeof(length); \
|
||||
processedBytes += sizeof(length); \
|
||||
QUuid value((const char*)dataAt); \
|
||||
QByteArray ba((const char*)dataAt, length); \
|
||||
QUuid value = QUuid::fromRfc4122(ba); \
|
||||
dataAt += length; \
|
||||
processedBytes += length; \
|
||||
properties.O(value); \
|
||||
|
|
Loading…
Reference in a new issue