mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-28 07:48:37 -04:00
physics: Fix crash in PhysicsNode::add_physicals_from()
This commit is contained in:
parent
74910ff310
commit
f1782d73e5
@ -72,13 +72,12 @@ make_copy() const {
|
|||||||
*/
|
*/
|
||||||
void PhysicalNode::
|
void PhysicalNode::
|
||||||
add_physicals_from(const PhysicalNode &other) {
|
add_physicals_from(const PhysicalNode &other) {
|
||||||
pvector< PT(Physical) >::iterator last = _physicals.end() - 1;
|
size_t num_physicals = _physicals.size();
|
||||||
|
|
||||||
_physicals.insert(_physicals.end(),
|
_physicals.insert(_physicals.end(),
|
||||||
other._physicals.begin(), other._physicals.end());
|
other._physicals.begin(), other._physicals.end());
|
||||||
|
|
||||||
for (; last != _physicals.end(); last++) {
|
for (size_t i = num_physicals; i < _physicals.size(); ++i) {
|
||||||
(*last)->_physical_node = this;
|
_physicals[i]->_physical_node = this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user