Position updates not sent for subs docked to the second main sub
This commit is contained in:
@@ -612,7 +612,11 @@ namespace Barotrauma
|
||||
|
||||
subBody.Update(deltaTime);
|
||||
|
||||
if (this != MainSub && MainSub.DockedTo.Contains(this)) return;
|
||||
for (int i = 0; i < 2; i++ )
|
||||
{
|
||||
if (Submarine.MainSubs[i] == null) continue;
|
||||
if (this != Submarine.MainSubs[i] && Submarine.MainSubs[i].DockedTo.Contains(this)) return;
|
||||
}
|
||||
|
||||
//send updates more frequently if moving fast
|
||||
networkUpdateTimer -= MathHelper.Clamp(Velocity.Length()*10.0f, 0.1f, 5.0f) * deltaTime;
|
||||
|
||||
@@ -331,6 +331,11 @@ namespace Barotrauma
|
||||
|
||||
public void SetTransform(Vector2 position, float rotation)
|
||||
{
|
||||
System.Diagnostics.Debug.Assert(MathUtils.IsValid(position));
|
||||
System.Diagnostics.Debug.Assert(Math.Abs(position.X) < 1000000.0f);
|
||||
System.Diagnostics.Debug.Assert(Math.Abs(position.Y) < 1000000.0f);
|
||||
|
||||
|
||||
body.SetTransform(position, rotation);
|
||||
SetPrevTransform(position, rotation);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user