mirror of
https://github.com/lubosz/overte.git
synced 2025-08-14 03:39:32 +02:00
always check added avatar entities once in updateAvatarEntities
This commit is contained in:
parent
25876bca63
commit
99f532a20e
3 changed files with 4 additions and 6 deletions
|
@ -2692,7 +2692,7 @@ void AvatarData::setAttachmentsVariant(const QVariantList& variant) {
|
||||||
|
|
||||||
const int MAX_NUM_AVATAR_ENTITIES = 42;
|
const int MAX_NUM_AVATAR_ENTITIES = 42;
|
||||||
|
|
||||||
void AvatarData::updateAvatarEntity(const QUuid& entityID, const QByteArray& entityData, bool requiresTreeUpdate) {
|
void AvatarData::updateAvatarEntity(const QUuid& entityID, const QByteArray& entityData) {
|
||||||
_avatarEntitiesLock.withWriteLock([&] {
|
_avatarEntitiesLock.withWriteLock([&] {
|
||||||
AvatarEntityMap::iterator itr = _avatarEntityData.find(entityID);
|
AvatarEntityMap::iterator itr = _avatarEntityData.find(entityID);
|
||||||
if (itr == _avatarEntityData.end()) {
|
if (itr == _avatarEntityData.end()) {
|
||||||
|
@ -2704,9 +2704,7 @@ void AvatarData::updateAvatarEntity(const QUuid& entityID, const QByteArray& ent
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (requiresTreeUpdate) {
|
_avatarEntityDataChanged = true;
|
||||||
_avatarEntityDataChanged = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_clientTraitsHandler) {
|
if (_clientTraitsHandler) {
|
||||||
// we have a client traits handler, so we need to mark this instanced trait as changed
|
// we have a client traits handler, so we need to mark this instanced trait as changed
|
||||||
|
|
|
@ -925,7 +925,7 @@ public:
|
||||||
* @param {Uuid} entityID
|
* @param {Uuid} entityID
|
||||||
* @param {string} entityData
|
* @param {string} entityData
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE void updateAvatarEntity(const QUuid& entityID, const QByteArray& entityData, bool requiresTreeUpdate = true);
|
Q_INVOKABLE void updateAvatarEntity(const QUuid& entityID, const QByteArray& entityData);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* @function MyAvatar.clearAvatarEntity
|
* @function MyAvatar.clearAvatarEntity
|
||||||
|
|
|
@ -74,7 +74,7 @@ void EntityEditPacketSender::queueEditAvatarEntityMessage(PacketType type,
|
||||||
jsonProperties = QJsonDocument(jsonObject);
|
jsonProperties = QJsonDocument(jsonObject);
|
||||||
|
|
||||||
QByteArray binaryProperties = jsonProperties.toBinaryData();
|
QByteArray binaryProperties = jsonProperties.toBinaryData();
|
||||||
_myAvatar->updateAvatarEntity(entityItemID, binaryProperties, false);
|
_myAvatar->updateAvatarEntity(entityItemID, binaryProperties);
|
||||||
|
|
||||||
entity->setLastBroadcast(usecTimestampNow());
|
entity->setLastBroadcast(usecTimestampNow());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue