mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-27 15:25:54 -04:00
physics: Don't assert destructing
This could have been produced with make_copy(), which can create a situation where the Physical objects don't have the same node associated -- see b6a118448dce974d25c1d5ae4043baa6dfe12db0
This commit is contained in:
parent
b6a118448d
commit
74910ff310
@ -43,13 +43,12 @@ PhysicalNode(const PhysicalNode ©) :
|
|||||||
*/
|
*/
|
||||||
PhysicalNode::
|
PhysicalNode::
|
||||||
~PhysicalNode() {
|
~PhysicalNode() {
|
||||||
PhysicalsVector::iterator it;
|
for (Physical *physical : _physicals) {
|
||||||
for (it = _physicals.begin(); it != _physicals.end(); ++it) {
|
if (physical->_physical_node == this) {
|
||||||
Physical *physical = *it;
|
physical->_physical_node = nullptr;
|
||||||
nassertd(physical->_physical_node == this) continue;
|
if (physical->_physics_manager != nullptr) {
|
||||||
physical->_physical_node = nullptr;
|
physical->_physics_manager->remove_physical(physical);
|
||||||
if (physical->_physics_manager != nullptr) {
|
}
|
||||||
physical->_physics_manager->remove_physical(physical);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user