fix bad startPosition in datagram unpack

The startPosition was wrong (too far back) and the bytesRead return
value was too big and the unpacking of the second chunk of the
datagram would start in the middle of the chunk.
This commit is contained in:
Andrew Meadows 2014-03-18 17:42:58 -07:00
parent 500f9d1485
commit 6340024daa

View file

@ -176,8 +176,8 @@ int AvatarData::parseDataAtOffset(const QByteArray& packet, int offset) {
_handData = new HandData(this);
}
const unsigned char* startPosition = reinterpret_cast<const unsigned char*>(packet.data());
const unsigned char* sourceBuffer = startPosition + offset;
const unsigned char* startPosition = reinterpret_cast<const unsigned char*>(packet.data()) + offset;
const unsigned char* sourceBuffer = startPosition;
// Body world position
memcpy(&_position, sourceBuffer, sizeof(float) * 3);