Physics2D/RigidBody2D: Fix crash when moving an already moved value
This commit is contained in:
parent
3507ec570f
commit
63e74b4f47
|
|
@ -609,9 +609,12 @@ namespace Nz
|
||||||
m_velocityFunc = std::move(object.m_velocityFunc);
|
m_velocityFunc = std::move(object.m_velocityFunc);
|
||||||
m_world = object.m_world;
|
m_world = object.m_world;
|
||||||
|
|
||||||
cpBodySetUserData(m_handle, this);
|
if (m_handle)
|
||||||
for (cpShape* shape : m_shapes)
|
{
|
||||||
cpShapeSetUserData(shape, this);
|
cpBodySetUserData(m_handle, this);
|
||||||
|
for (cpShape* shape : m_shapes)
|
||||||
|
cpShapeSetUserData(shape, this);
|
||||||
|
}
|
||||||
|
|
||||||
object.m_handle = nullptr;
|
object.m_handle = nullptr;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue