mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 07:34:02 +02:00
if an action changes its own arguments, cause reserialisation
This commit is contained in:
parent
85f206d49d
commit
a01fb6f1dc
3 changed files with 14 additions and 0 deletions
|
@ -147,6 +147,10 @@ bool AvatarActionHold::updateArguments(QVariantMap arguments) {
|
|||
_rotationalTargetSet = true;
|
||||
_active = true;
|
||||
unlock();
|
||||
auto ownerEntity = _ownerEntity.lock();
|
||||
if (ownerEntity) {
|
||||
ownerEntity->setActionDataDirty(true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -1714,6 +1714,14 @@ QByteArray EntityItem::serializeActions(bool& success) const {
|
|||
}
|
||||
|
||||
const QByteArray EntityItem::getActionData() const {
|
||||
if (_actionDataDirty) {
|
||||
bool success;
|
||||
QByteArray newDataCache = serializeActions(success);
|
||||
if (success) {
|
||||
_allActionsDataCache = newDataCache;
|
||||
}
|
||||
_actionDataDirty = false;
|
||||
}
|
||||
return _allActionsDataCache;
|
||||
}
|
||||
|
||||
|
|
|
@ -395,6 +395,7 @@ public:
|
|||
bool hasActions() { return !_objectActions.empty(); }
|
||||
QList<QUuid> getActionIDs() { return _objectActions.keys(); }
|
||||
QVariantMap getActionArguments(const QUuid& actionID) const;
|
||||
void setActionDataDirty(bool value) const { _actionDataDirty = value; }
|
||||
|
||||
protected:
|
||||
|
||||
|
@ -482,6 +483,7 @@ protected:
|
|||
void checkWaitingToRemove(EntitySimulation* simulation = nullptr);
|
||||
mutable QByteArray _waitingActionData;
|
||||
mutable QSet<QUuid> _actionsToRemove;
|
||||
mutable bool _actionDataDirty = false;
|
||||
};
|
||||
|
||||
#endif // hifi_EntityItem_h
|
||||
|
|
Loading…
Reference in a new issue