Ragdolls can't be dragged through walls or other colliders. Closes #772
This commit is contained in:
@@ -1083,8 +1083,31 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Limb pullLimb = i == 0 ? leftHand : rightHand;
|
||||
|
||||
if (GameMain.Client == null)
|
||||
{
|
||||
//stop dragging if there's something between the pull limb and the target limb
|
||||
Vector2 sourceSimPos = pullLimb.SimPosition;
|
||||
Vector2 targetSimPos = targetLimb.SimPosition;
|
||||
if (character.Submarine != null && character.SelectedCharacter.Submarine == null)
|
||||
{
|
||||
targetSimPos -= character.Submarine.SimPosition;
|
||||
}
|
||||
else if (character.Submarine == null && character.SelectedCharacter.Submarine != null)
|
||||
{
|
||||
sourceSimPos -= character.SelectedCharacter.Submarine.SimPosition;
|
||||
}
|
||||
|
||||
var body = Submarine.CheckVisibility(sourceSimPos, targetSimPos, ignoreSubs: true);
|
||||
if (body != null)
|
||||
{
|
||||
character.DeselectCharacter();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (i == 1 && inWater)
|
||||
{
|
||||
targetLimb.pullJoint.Enabled = false;
|
||||
|
||||
Reference in New Issue
Block a user