Fixed severed limbs coming back together when SimplePhysicsEnabled is toggled off and on
This commit is contained in:
@@ -162,15 +162,16 @@ namespace Barotrauma
|
|||||||
limb.body.Enabled = !simplePhysicsEnabled;
|
limb.body.Enabled = !simplePhysicsEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (RevoluteJoint joint in LimbJoints)
|
foreach (LimbJoint joint in LimbJoints)
|
||||||
{
|
{
|
||||||
joint.Enabled = !simplePhysicsEnabled;
|
joint.Enabled = !joint.IsSevered && !simplePhysicsEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!simplePhysicsEnabled)
|
if (!simplePhysicsEnabled)
|
||||||
{
|
{
|
||||||
foreach (Limb limb in Limbs)
|
foreach (Limb limb in Limbs)
|
||||||
{
|
{
|
||||||
|
if (limb.IsSevered) continue;
|
||||||
limb.body.SetTransform(Collider.SimPosition, Collider.Rotation);
|
limb.body.SetTransform(Collider.SimPosition, Collider.Rotation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user