mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
assertions in remove physical
This commit is contained in:
parent
9a647cf23f
commit
f8c00270d3
@ -106,6 +106,7 @@ remove_angular_force(AngularForce *f) {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
void PhysicsManager::
|
void PhysicsManager::
|
||||||
remove_physical(Physical *p) {
|
remove_physical(Physical *p) {
|
||||||
|
nassertv(this);
|
||||||
nassertv(p);
|
nassertv(p);
|
||||||
pvector< Physical * >::iterator found;
|
pvector< Physical * >::iterator found;
|
||||||
|
|
||||||
@ -113,8 +114,11 @@ remove_physical(Physical *p) {
|
|||||||
if (found == _physicals.end()) {
|
if (found == _physicals.end()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
nassertv(*found == p);
|
||||||
|
nassertv(p->_physics_manager != (PhysicsManager *) NULL);
|
||||||
p->_physics_manager = (PhysicsManager *) NULL;
|
p->_physics_manager = (PhysicsManager *) NULL;
|
||||||
_physicals.erase(found);
|
_physicals.erase(found);
|
||||||
|
nassertv(_physicals.end() == find(_physicals.begin(), _physicals.end(), p));
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
Loading…
x
Reference in New Issue
Block a user