Physics2D/RigidBody2D: Fix crash when moving an already moved value
This commit is contained in:
@@ -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;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user