diff --git a/Subsurface/Source/GameSession/GameModes/Tutorials/BasicTutorial.cs b/Subsurface/Source/GameSession/GameModes/Tutorials/BasicTutorial.cs index fd6270a7e..d48bb1f80 100644 --- a/Subsurface/Source/GameSession/GameModes/Tutorials/BasicTutorial.cs +++ b/Subsurface/Source/GameSession/GameModes/Tutorials/BasicTutorial.cs @@ -283,7 +283,7 @@ namespace Barotrauma.Tutorials infoBox = CreateInfoFrame("Steer the submarine downwards, heading further into the cavern."); - while (Submarine.MainSub.WorldPosition.Y > 31900.0f) + while (Submarine.MainSub.WorldPosition.Y > 36500.0f) { yield return CoroutineStatus.Running; } diff --git a/Subsurface/Source/GameSession/GameSession.cs b/Subsurface/Source/GameSession/GameSession.cs index 3414f680b..c743ef206 100644 --- a/Subsurface/Source/GameSession/GameSession.cs +++ b/Subsurface/Source/GameSession/GameSession.cs @@ -142,7 +142,17 @@ namespace Barotrauma { dummyLocations = new Location[2]; - MTRandom rand = new MTRandom(ToolBox.StringToInt(GameMain.NetLobbyScreen.LevelSeed)); + string seed = ""; + if (GameMain.GameSession != null && GameMain.GameSession.Level != null) + { + seed = GameMain.GameSession.Level.Seed; + } + else if (GameMain.NetLobbyScreen != null) + { + seed = GameMain.NetLobbyScreen.LevelSeed; + } + + MTRandom rand = new MTRandom(ToolBox.StringToInt(seed)); for (int i = 0; i < 2; i++) { dummyLocations[i] = Location.CreateRandom(new Vector2((float)rand.NextDouble() * 10000.0f, (float)rand.NextDouble() * 10000.0f)); diff --git a/Subsurface/Source/Items/CharacterInventory.cs b/Subsurface/Source/Items/CharacterInventory.cs index 0f5c50f57..ab1cbd4d5 100644 --- a/Subsurface/Source/Items/CharacterInventory.cs +++ b/Subsurface/Source/Items/CharacterInventory.cs @@ -184,6 +184,11 @@ namespace Barotrauma placed = true; } } + + if (placed) + { + return true; + } } diff --git a/Subsurface/Source/Networking/GameServer.cs b/Subsurface/Source/Networking/GameServer.cs index 961e7d46a..16a546cf7 100644 --- a/Subsurface/Source/Networking/GameServer.cs +++ b/Subsurface/Source/Networking/GameServer.cs @@ -886,22 +886,22 @@ namespace Barotrauma.Networking roundStartSeed = DateTime.Now.Millisecond; Rand.SetSyncedSeed(roundStartSeed); - - GameMain.GameSession = new GameSession(selectedSub, "", selectedMode, Mission.MissionTypes[GameMain.NetLobbyScreen.MissionTypeIndex]); - yield return CoroutineStatus.Running; + bool couldNotStart = false; int teamCount = 1; int hostTeam = 1; - if (GameMain.GameSession.gameMode.Mission != null && - GameMain.GameSession.gameMode.Mission.AssignTeamIDs(connectedClients,out hostTeam)) - { - teamCount = 2; - } - bool couldNotStart = false; try - { + { + GameMain.GameSession = new GameSession(selectedSub, "", selectedMode, Mission.MissionTypes[GameMain.NetLobbyScreen.MissionTypeIndex]); + + if (GameMain.GameSession.gameMode.Mission != null && + GameMain.GameSession.gameMode.Mission.AssignTeamIDs(connectedClients,out hostTeam)) + { + teamCount = 2; + } + GameMain.GameSession.StartShift(GameMain.NetLobbyScreen.LevelSeed, teamCount > 1); } @@ -914,7 +914,6 @@ namespace Barotrauma.Networking GameMain.NetLobbyScreen.StartButton.Enabled = true; couldNotStart = true; - } if (couldNotStart) yield return CoroutineStatus.Failure;