mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-13 07:55:15 +02:00
clean up left-over action if it's re-added
This commit is contained in:
parent
300d35219d
commit
31a3ca641d
2 changed files with 13 additions and 2 deletions
|
@ -436,12 +436,22 @@ int16_t PhysicsEngine::getCollisionMask(int16_t group) const {
|
|||
return mask ? *mask : COLLISION_MASK_DEFAULT;
|
||||
}
|
||||
|
||||
EntityActionPointer PhysicsEngine::getActionByID(const QUuid& actionID) const {
|
||||
if (_objectActions.contains(actionID)) {
|
||||
return _objectActions[actionID];
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
void PhysicsEngine::addAction(EntityActionPointer action) {
|
||||
assert(action);
|
||||
const QUuid& actionID = action->getID();
|
||||
if (_objectActions.contains(actionID)) {
|
||||
assert(_objectActions[actionID] == action);
|
||||
return;
|
||||
if (_objectActions[actionID] == action) {
|
||||
return;
|
||||
}
|
||||
removeAction(action->getID());
|
||||
}
|
||||
|
||||
_objectActions[actionID] = action;
|
||||
|
|
|
@ -94,6 +94,7 @@ public:
|
|||
|
||||
int16_t getCollisionMask(int16_t group) const;
|
||||
|
||||
EntityActionPointer getActionByID(const QUuid& actionID) const;
|
||||
void addAction(EntityActionPointer action);
|
||||
void removeAction(const QUuid actionID);
|
||||
|
||||
|
|
Loading…
Reference in a new issue