Submarine position is synced using the same logic as the characters, AICharacter position syncing

This commit is contained in:
Regalis
2016-10-25 19:01:19 +03:00
parent ac8edb5b2a
commit 07f8c966ab
12 changed files with 234 additions and 256 deletions
@@ -271,6 +271,7 @@ namespace Barotrauma.Networking
GameMain.NetLobbyScreen.Select();
new GUIMessageBox("Connection timed out", "You were disconnected for too long and your character was deleted. Please wait for another round to start.");
myCharacter = null;
}
GameMain.NetLobbyScreen.ClearPlayers();
@@ -231,8 +231,8 @@ namespace Barotrauma.Networking
if (updateReturnTimer > 10.0f)
{
updateReturnTimer = 0.0f;
respawnShuttle.SubBody.Body.IgnoreCollisionWith(Level.Loaded.ShaftBody);
respawnShuttle.PhysicsBody.FarseerBody.IgnoreCollisionWith(Level.Loaded.ShaftBody);
shuttleSteering.AutoPilot = true;
shuttleSteering.MaintainPos = false;
@@ -302,7 +302,7 @@ namespace Barotrauma.Networking
private IEnumerable<object> ForceShuttleToPos(Vector2 position, float speed)
{
respawnShuttle.SubBody.Body.IgnoreCollisionWith(Level.Loaded.ShaftBody);
respawnShuttle.PhysicsBody.FarseerBody.IgnoreCollisionWith(Level.Loaded.ShaftBody);
while (Math.Abs(position.Y - respawnShuttle.WorldPosition.Y) > 100.0f)
{
@@ -313,7 +313,7 @@ namespace Barotrauma.Networking
if (respawnShuttle.SubBody == null) yield return CoroutineStatus.Success;
}
respawnShuttle.SubBody.Body.RestoreCollisionWith(Level.Loaded.ShaftBody);
respawnShuttle.PhysicsBody.FarseerBody.RestoreCollisionWith(Level.Loaded.ShaftBody);
yield return CoroutineStatus.Success;
}
@@ -378,7 +378,7 @@ namespace Barotrauma.Networking
respawnShuttle.Velocity = Vector2.Zero;
respawnShuttle.SubBody.Body.RestoreCollisionWith(Level.Loaded.ShaftBody);
respawnShuttle.PhysicsBody.FarseerBody.RestoreCollisionWith(Level.Loaded.ShaftBody);
}