mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 17:35:08 +02:00
avoid sending localPosition for avatars with no parent
This commit is contained in:
parent
27d55d6ff0
commit
b333126cbe
1 changed files with 7 additions and 4 deletions
|
@ -260,8 +260,8 @@ QByteArray AvatarData::toByteArray(AvatarDataDetail dataDetail, quint64 lastSent
|
|||
// separately
|
||||
bool hasParentInfo = sendAll || parentInfoChangedSince(lastSentTime);
|
||||
bool hasAvatarLocalPosition = sendAll ||
|
||||
(hasParent() && tranlationChangedSince(lastSentTime)) ||
|
||||
parentInfoChangedSince(lastSentTime);
|
||||
(hasParent() && (tranlationChangedSince(lastSentTime) ||
|
||||
parentInfoChangedSince(lastSentTime)));
|
||||
|
||||
bool hasFaceTrackerInfo = hasFaceTracker() && (sendAll || faceTrackerInfoChangedSince(lastSentTime));
|
||||
bool hasJointData = sendAll || !sendMinimum;
|
||||
|
@ -916,7 +916,6 @@ int AvatarData::parseDataFromBuffer(const QByteArray& buffer) {
|
|||
}
|
||||
|
||||
if (hasAvatarLocalPosition) {
|
||||
assert(hasParent()); // we shouldn't have local position unless we have a parent
|
||||
auto startSection = sourceBuffer;
|
||||
|
||||
PACKET_READ_CHECK(AvatarLocalPosition, sizeof(AvatarDataPacket::AvatarLocalPosition));
|
||||
|
@ -928,7 +927,11 @@ int AvatarData::parseDataFromBuffer(const QByteArray& buffer) {
|
|||
}
|
||||
return buffer.size();
|
||||
}
|
||||
setLocalPosition(position);
|
||||
if (hasParent()) {
|
||||
setLocalPosition(position);
|
||||
} else {
|
||||
qCWarning(avatars) << "received localPosition for avatar with no parent";
|
||||
}
|
||||
sourceBuffer += sizeof(AvatarDataPacket::AvatarLocalPosition);
|
||||
int numBytesRead = sourceBuffer - startSection;
|
||||
_localPositionRate.increment(numBytesRead);
|
||||
|
|
Loading…
Reference in a new issue