Some extra checks to prevent character flinging
New netcode will solve all of these problems the right way.
This commit is contained in:
@@ -2028,9 +2028,15 @@ namespace Barotrauma
|
||||
AnimController.Teleport(pos - SimPosition, Vector2.Zero);
|
||||
}
|
||||
|
||||
if ((pos-SimPosition).Length()>600.0f)
|
||||
{
|
||||
AnimController.Teleport(pos - SimPosition, -AnimController.RefLimb.LinearVelocity);
|
||||
}
|
||||
|
||||
if (inSub)
|
||||
{
|
||||
//AnimController.FindHull(ConvertUnits.ToDisplayUnits(pos) - Submarine.Loaded.WorldPosition);
|
||||
Submarine prevSub = Submarine;
|
||||
|
||||
Hull newHull = Hull.FindHull(ConvertUnits.ToDisplayUnits(pos), AnimController.CurrentHull, false);
|
||||
if (newHull != null)
|
||||
@@ -2038,6 +2044,11 @@ namespace Barotrauma
|
||||
AnimController.CurrentHull = newHull;
|
||||
Submarine = newHull.Submarine;
|
||||
}
|
||||
|
||||
if (prevSub != null && Submarine != null && prevSub!=Submarine)
|
||||
{
|
||||
AnimController.Teleport(pos - SimPosition, Vector2.Zero);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user