mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 09:24:00 +02:00
add sanity check to PhysicalEntitySimulation::addAction
This commit is contained in:
parent
31a3ca641d
commit
1326791502
2 changed files with 14 additions and 0 deletions
|
@ -235,6 +235,19 @@ void PhysicalEntitySimulation::handleCollisionEvents(CollisionEvents& collisionE
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void PhysicalEntitySimulation::addAction(EntityActionPointer action) {
|
||||
if (_physicsEngine) {
|
||||
lock();
|
||||
const QUuid& actionID = action->getID();
|
||||
if (_physicsEngine->getActionByID(actionID)) {
|
||||
qDebug() << "warning -- PhysicalEntitySimulation::addAction -- adding an action that was already in _physicsEngine";
|
||||
}
|
||||
unlock();
|
||||
EntitySimulation::addAction(action);
|
||||
}
|
||||
}
|
||||
|
||||
void PhysicalEntitySimulation::applyActionChanges() {
|
||||
if (_physicsEngine) {
|
||||
lock();
|
||||
|
|
|
@ -32,6 +32,7 @@ public:
|
|||
|
||||
void init(EntityTree* tree, PhysicsEngine* engine, EntityEditPacketSender* packetSender);
|
||||
|
||||
virtual void addAction(EntityActionPointer action);
|
||||
virtual void applyActionChanges();
|
||||
|
||||
protected: // only called by EntitySimulation
|
||||
|
|
Loading…
Reference in a new issue