diff --git a/Barotrauma/BarotraumaClient/Source/GameMain.cs b/Barotrauma/BarotraumaClient/Source/GameMain.cs index 09c332ced..d08306bd4 100644 --- a/Barotrauma/BarotraumaClient/Source/GameMain.cs +++ b/Barotrauma/BarotraumaClient/Source/GameMain.cs @@ -601,8 +601,7 @@ namespace Barotrauma { ((GUIMessageBox)GUIMessageBox.VisibleBox).Close(); } - else if ((Character.Controlled?.SelectedConstruction == null || !Character.Controlled.SelectedConstruction.ActiveHUDs.Any(ic => ic.GuiFrame != null)) - && Inventory.SelectedSlot == null && CharacterHealth.OpenHealthWindow == null) + else if ((GUI.MouseOn == null || GUI.IsMouseOn(GUI.PauseMenu)) && Inventory.SelectedSlot == null && CharacterHealth.OpenHealthWindow == null) { // Otherwise toggle pausing, unless another window/interface is open. GUI.TogglePauseMenu(); diff --git a/Barotrauma/BarotraumaClient/Source/GameSession/GameModes/Tutorials/ContextualTutorial.cs b/Barotrauma/BarotraumaClient/Source/GameSession/GameModes/Tutorials/ContextualTutorial.cs index fe46adeae..58c578bf1 100644 --- a/Barotrauma/BarotraumaClient/Source/GameSession/GameModes/Tutorials/ContextualTutorial.cs +++ b/Barotrauma/BarotraumaClient/Source/GameSession/GameModes/Tutorials/ContextualTutorial.cs @@ -657,10 +657,9 @@ namespace Barotrauma.Tutorials { foreach (Gap gap in Gap.GapList) { - if (gap.ConnectedWall == null || gap.IsRoomToRoom) continue; + if (gap.ConnectedWall == null) continue; if (gap.ConnectedDoor != null || gap.Open <= 0.0f) continue; if (gap.Submarine == null) continue; - if (gap.Submarine.IsOutpost) continue; if (gap.Submarine != Submarine.MainSub) continue; return true; } diff --git a/Barotrauma/BarotraumaShared/Source/Characters/AI/AITarget.cs b/Barotrauma/BarotraumaShared/Source/Characters/AI/AITarget.cs index 5384ef408..42f9d6515 100644 --- a/Barotrauma/BarotraumaShared/Source/Characters/AI/AITarget.cs +++ b/Barotrauma/BarotraumaShared/Source/Characters/AI/AITarget.cs @@ -15,6 +15,11 @@ namespace Barotrauma private set; } + /// + /// Use as a minimum or static sight range. + /// + public static float StaticSightRange = 3000; + private float soundRange; private float sightRange; @@ -110,9 +115,13 @@ namespace Barotrauma SonarLabel = element.GetAttributeString("sonarlabel", ""); } - public AITarget(Entity e, float sightRange = 3000, float soundRange = 0) + public AITarget(Entity e, float sightRange = -1, float soundRange = 0) { Entity = e; + if (sightRange < 0) + { + sightRange = StaticSightRange; + } SightRange = sightRange; SoundRange = soundRange; List.Add(this); diff --git a/Barotrauma/BarotraumaShared/Source/Map/Hull.cs b/Barotrauma/BarotraumaShared/Source/Map/Hull.cs index b9b71de7e..485a7b2bc 100644 --- a/Barotrauma/BarotraumaShared/Source/Map/Hull.cs +++ b/Barotrauma/BarotraumaShared/Source/Map/Hull.cs @@ -88,7 +88,6 @@ namespace Barotrauma Gap.UpdateHulls(); } - OxygenPercentage = prevOxygenPercentage; surface = drawSurface = rect.Y - rect.Height + WaterVolume / rect.Width; Pressure = surface; } @@ -420,7 +419,7 @@ namespace Barotrauma FireSource.UpdateAll(FireSources, deltaTime); - aiTarget.SightRange = Submarine == null ? 0.0f : Math.Max(Submarine.Velocity.Length() * 500.0f, 500.0f); + aiTarget.SightRange = Submarine == null ? 0.0f : Math.Max(Submarine.Velocity.Length() * 2000.0f, AITarget.StaticSightRange); aiTarget.SoundRange -= deltaTime * 1000.0f; if (!update)