diff --git a/Subsurface/Source/GameSession/GameSession.cs b/Subsurface/Source/GameSession/GameSession.cs index dcc2b0f54..9c8fc717e 100644 --- a/Subsurface/Source/GameSession/GameSession.cs +++ b/Subsurface/Source/GameSession/GameSession.cs @@ -119,7 +119,10 @@ namespace Barotrauma if (level != null) { level.Generate(); - submarine.SetPosition(level.StartPosition - new Vector2(0.0f, 2000.0f)); + + Vector2 subOffsetFromCenter = new Vector2(Submarine.Borders.Center.X, Submarine.Borders.Y - Submarine.Borders.Height / 2); + + submarine.SetPosition(level.StartPosition - subOffsetFromCenter - new Vector2(0.0f, 2000.0f)); GameMain.GameScreen.BackgroundCreatureManager.SpawnSprites(80); } diff --git a/Subsurface/Source/Items/Components/Holdable/RepairTool.cs b/Subsurface/Source/Items/Components/Holdable/RepairTool.cs index 7690b5a3d..5f0b0fa17 100644 --- a/Subsurface/Source/Items/Components/Holdable/RepairTool.cs +++ b/Subsurface/Source/Items/Components/Holdable/RepairTool.cs @@ -170,13 +170,19 @@ namespace Barotrauma.Items.Components //if the next section is small enough, apply the effect to it as well //(to make it easier to fix a small "left-over" section) - int nextSectionLength = targetStructure.SectionLength(sectionIndex + 1); - if (nextSectionLength > 0 && nextSectionLength < Structure.wallSectionSize * 0.3f) + for (int i = -1; i<2; i+=2) { - targetStructure.HighLightSection(sectionIndex + 1); - targetStructure.AddDamage(sectionIndex + 1, -StructureFixAmount * degreeOfSuccess); + int nextSectionLength = targetStructure.SectionLength(sectionIndex + i); + if ((sectionIndex==1 && i ==-1) || + (sectionIndex==targetStructure.SectionCount-2 && i == 1) || + (nextSectionLength > 0 && nextSectionLength < Structure.wallSectionSize * 0.3f)) + { + targetStructure.HighLightSection(sectionIndex + i); + targetStructure.AddDamage(sectionIndex + i, -StructureFixAmount * degreeOfSuccess); + } } + } else if ((targetLimb = (targetBody.UserData as Limb)) != null) { diff --git a/Subsurface/Source/Items/Components/Machines/Radar.cs b/Subsurface/Source/Items/Components/Machines/Radar.cs index eee114b86..83523e688 100644 --- a/Subsurface/Source/Items/Components/Machines/Radar.cs +++ b/Subsurface/Source/Items/Components/Machines/Radar.cs @@ -239,11 +239,11 @@ namespace Barotrauma.Items.Components DrawMarker(spriteBatch, (GameMain.GameSession.Map == null) ? "Start" : GameMain.GameSession.Map.CurrentLocation.Name, - (Level.Loaded.StartPosition - (Submarine.Loaded.Position + Submarine.HiddenSubPosition)), displayScale, center, (rect.Width * 0.55f)); + (Level.Loaded.StartPosition - item.WorldPosition), displayScale, center, (rect.Width * 0.55f)); DrawMarker(spriteBatch, (GameMain.GameSession.Map == null) ? "End" : GameMain.GameSession.Map.SelectedLocation.Name, - (Level.Loaded.EndPosition - (Submarine.Loaded.Position+Submarine.HiddenSubPosition)), displayScale, center, (rect.Width * 0.55f)); + (Level.Loaded.EndPosition - item.WorldPosition), displayScale, center, (rect.Width * 0.55f)); if (GameMain.GameSession.Mission != null) { @@ -253,7 +253,7 @@ namespace Barotrauma.Items.Components { DrawMarker(spriteBatch, mission.RadarLabel, - mission.RadarPosition - (Submarine.Loaded.Position + Submarine.HiddenSubPosition), displayScale, center, (rect.Width * 0.55f)); + mission.RadarPosition - item.WorldPosition, displayScale, center, (rect.Width * 0.55f)); } } diff --git a/Subsurface/Source/Map/Levels/Level.cs b/Subsurface/Source/Map/Levels/Level.cs index 4e1b7e858..c37692507 100644 --- a/Subsurface/Source/Map/Levels/Level.cs +++ b/Subsurface/Source/Map/Levels/Level.cs @@ -294,7 +294,7 @@ namespace Barotrauma wayPoint.MoveWithLevel = true; } - //startPosition = pathCells[0].Center; + startPosition.X = pathCells[0].Center.X; //endPosition = pathCells[pathCells.Count - 1].Center; foreach (List tunnel in smallTunnels) diff --git a/Subsurface/Source/Screens/ServerListScreen.cs b/Subsurface/Source/Screens/ServerListScreen.cs index e167d2266..a87ee6623 100644 --- a/Subsurface/Source/Screens/ServerListScreen.cs +++ b/Subsurface/Source/Screens/ServerListScreen.cs @@ -305,7 +305,7 @@ namespace Barotrauma var msgBox = new GUIMessageBox("Password required:", "", new string[] { "OK", "Cancel" }); var passwordBox = new GUITextBox(new Rectangle(0,40,150,25), Alignment.TopLeft, GUI.Style, msgBox.children[0]); passwordBox.UserData = "password"; - + var okButton = msgBox.Buttons[0]; var cancelButton = msgBox.Buttons[1];