Browse Source

Merge pull request #2117 from cadaver/fix-point-constraint

Fix programmatic point constraint creation after RigidBody component
Eugene Kozlov 8 years ago
parent
commit
cebfd83bc8
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Source/Urho3D/Physics/Constraint.cpp

+ 1 - 1
Source/Urho3D/Physics/Constraint.cpp

@@ -173,7 +173,7 @@ void Constraint::DrawDebugGeometry(DebugRenderer* debug, bool depthTest)
 
 void Constraint::SetConstraintType(ConstraintType type)
 {
-    if (type != constraintType_)
+    if (type != constraintType_ || !constraint_)
     {
         constraintType_ = type;
         CreateConstraint();