diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 7d2d10a96..9dbab7f6f 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -27,13 +27,15 @@ body: attributes: label: Reproduction steps description: | - If possible, describe how the developers can get the bug to happen. It is often extremely hard to fix a bug if we don't know how to reproduce it. + If possible, describe how the developers can get the bug to happen (or, in other words, what actions lead to you encountering the bug). **This is by far the most important part of the report** - it is often extremely difficult, or even impossible, to diagnose an issue if we don't know the conditions it occurs in. If you have a save, a submarine file, screenshots or any other files that might help us diagnose the issue, you can attach them here. Note that GitHub doesn't support the .save or .sub file extensions, so you should .zip those types of files to allow them to be attached. placeholder: | 1. Start a multiplayer campaign 2. Spawn a bike horn with console commands 3. Use the bike horn 4. Observe how the game crashes + validations: + required: true - type: dropdown id: prevalence attributes: @@ -52,8 +54,8 @@ body: label: Version description: Which version of the game did the bug happen in? You can see the current version number in the bottom left corner of your screen in the main menu. options: - - v1.0.8.0 - - Unstable (v1.1.3.0) + - v1.0.9.0 + - Unstable (v1.1.4.0) - Other validations: required: true diff --git a/Barotrauma/BarotraumaClient/ClientSource/GUI/GUITextBox.cs b/Barotrauma/BarotraumaClient/ClientSource/GUI/GUITextBox.cs index ea2b67b4b..27b9edd60 100644 --- a/Barotrauma/BarotraumaClient/ClientSource/GUI/GUITextBox.cs +++ b/Barotrauma/BarotraumaClient/ClientSource/GUI/GUITextBox.cs @@ -811,6 +811,7 @@ namespace Barotrauma IEnumerable GetAndSortTextBoxes(GUIComponent parent) => parent.GetAllChildren().OrderBy(t => t.Rect.Y).ThenBy(t => t.Rect.X); GUITextBox SelectNextTextBox(GUIListBox listBox) { + if (listBox?.SelectedComponent == null) { return null; } var textBoxes = GetAndSortTextBoxes(listBox.SelectedComponent); if (textBoxes.Any()) { diff --git a/Barotrauma/BarotraumaClient/ClientSource/Map/Lights/LightManager.cs b/Barotrauma/BarotraumaClient/ClientSource/Map/Lights/LightManager.cs index 4d734fc23..37b05c639 100644 --- a/Barotrauma/BarotraumaClient/ClientSource/Map/Lights/LightManager.cs +++ b/Barotrauma/BarotraumaClient/ClientSource/Map/Lights/LightManager.cs @@ -155,7 +155,7 @@ namespace Barotrauma.Lights { foreach (LightSource light in lights) { - light.NeedsHullCheck = true; + light.HullsUpToDate.Clear(); light.NeedsRecalculation = true; } } diff --git a/Barotrauma/BarotraumaClient/ClientSource/Map/Lights/LightSource.cs b/Barotrauma/BarotraumaClient/ClientSource/Map/Lights/LightSource.cs index eaca44df3..428d4e0b3 100644 --- a/Barotrauma/BarotraumaClient/ClientSource/Map/Lights/LightSource.cs +++ b/Barotrauma/BarotraumaClient/ClientSource/Map/Lights/LightSource.cs @@ -222,9 +222,10 @@ namespace Barotrauma.Lights private float prevCalculatedRange; private Vector2 prevCalculatedPosition; - //do we need to recheck which convex hulls are within range - //(e.g. position or range of the lightsource has changed) - public bool NeedsHullCheck = true; + //Which submarines' convex hulls are up to date? Resets when the item moves/rotates relative to the submarine. + //Can contain null (means convex hulls that aren't part of any submarine). + public HashSet HullsUpToDate = new HashSet(); + //do we need to recalculate the vertices of the light volume private bool needsRecalculation; public bool NeedsRecalculation @@ -277,7 +278,7 @@ namespace Barotrauma.Lights return; } - NeedsHullCheck = true; + HullsUpToDate.Clear(); NeedsRecalculation = true; } } @@ -298,7 +299,7 @@ namespace Barotrauma.Lights return; } - NeedsHullCheck = true; + HullsUpToDate.Clear(); NeedsRecalculation = true; } } @@ -368,7 +369,7 @@ namespace Barotrauma.Lights lightSourceParams.Range = value; if (Math.Abs(prevCalculatedRange - lightSourceParams.Range) < 10.0f) return; - NeedsHullCheck = true; + HullsUpToDate.Clear(); NeedsRecalculation = true; prevCalculatedRange = lightSourceParams.Range; } @@ -384,8 +385,8 @@ namespace Barotrauma.Lights set { NeedsRecalculation = true; - NeedsHullCheck = true; lightTextureTargetSize = value; + HullsUpToDate.Clear(); } } @@ -526,7 +527,7 @@ namespace Barotrauma.Lights chList.List.Add(convexHull); } chList.IsHidden.RemoveWhere(ch => !chList.List.Contains(ch)); - NeedsHullCheck = false; + HullsUpToDate.Add(sub); } /// @@ -571,7 +572,7 @@ namespace Barotrauma.Lights //light and the convexhulls are both outside if (sub == null) { - if (NeedsHullCheck) + if (!HullsUpToDate.Contains(null)) { RefreshConvexHullList(chList, lightPos, null); } @@ -603,7 +604,7 @@ namespace Barotrauma.Lights //light and convexhull are both inside the same sub if (sub == ParentSub) { - if (NeedsHullCheck) + if (!HullsUpToDate.Contains(sub)) { RefreshConvexHullList(chList, lightPos, sub); } @@ -611,7 +612,7 @@ namespace Barotrauma.Lights //light and convexhull are inside different subs else { - if (sub.DockedTo.Contains(ParentSub) && !NeedsHullCheck) { return; } + if (sub.DockedTo.Contains(ParentSub) && HullsUpToDate.Contains(sub)) { return; } lightPos -= (sub.Position - ParentSub.Position); @@ -1385,9 +1386,9 @@ namespace Barotrauma.Lights public void Reset() { + HullsUpToDate.Clear(); convexHullsInRange.Clear(); diffToSub.Clear(); - NeedsHullCheck = true; NeedsRecalculation = true; vertexCount = 0; diff --git a/Barotrauma/BarotraumaClient/LinuxClient.csproj b/Barotrauma/BarotraumaClient/LinuxClient.csproj index 497b421e6..123099431 100644 --- a/Barotrauma/BarotraumaClient/LinuxClient.csproj +++ b/Barotrauma/BarotraumaClient/LinuxClient.csproj @@ -11,8 +11,8 @@ Barotrauma FakeFish, Undertow Games Barotrauma - 1.0.8.0 - Copyright © FakeFish 2018-2022 + 1.0.9.0 + Copyright © FakeFish 2018-2023 AnyCPU;x64 Barotrauma ..\BarotraumaShared\Icon.ico diff --git a/Barotrauma/BarotraumaClient/MacClient.csproj b/Barotrauma/BarotraumaClient/MacClient.csproj index 1c5a8548d..b1eb4dd7a 100644 --- a/Barotrauma/BarotraumaClient/MacClient.csproj +++ b/Barotrauma/BarotraumaClient/MacClient.csproj @@ -11,8 +11,8 @@ Barotrauma FakeFish, Undertow Games Barotrauma - 1.0.8.0 - Copyright © FakeFish 2018-2022 + 1.0.9.0 + Copyright © FakeFish 2018-2023 AnyCPU;x64 Barotrauma ..\BarotraumaShared\Icon.ico diff --git a/Barotrauma/BarotraumaClient/WindowsClient.csproj b/Barotrauma/BarotraumaClient/WindowsClient.csproj index 2ff4b2531..551ee0da7 100644 --- a/Barotrauma/BarotraumaClient/WindowsClient.csproj +++ b/Barotrauma/BarotraumaClient/WindowsClient.csproj @@ -11,8 +11,8 @@ Barotrauma FakeFish, Undertow Games Barotrauma - 1.0.8.0 - Copyright © FakeFish 2018-2022 + 1.0.9.0 + Copyright © FakeFish 2018-2023 AnyCPU;x64 Barotrauma ..\BarotraumaShared\Icon.ico diff --git a/Barotrauma/BarotraumaServer/LinuxServer.csproj b/Barotrauma/BarotraumaServer/LinuxServer.csproj index 0bac3ad9e..029403e88 100644 --- a/Barotrauma/BarotraumaServer/LinuxServer.csproj +++ b/Barotrauma/BarotraumaServer/LinuxServer.csproj @@ -11,7 +11,7 @@ Barotrauma FakeFish, Undertow Games Barotrauma Dedicated Server - 1.0.8.0 + 1.0.9.0 Copyright © FakeFish 2018-2022 AnyCPU;x64 DedicatedServer diff --git a/Barotrauma/BarotraumaServer/MacServer.csproj b/Barotrauma/BarotraumaServer/MacServer.csproj index dddcbb464..671f62f24 100644 --- a/Barotrauma/BarotraumaServer/MacServer.csproj +++ b/Barotrauma/BarotraumaServer/MacServer.csproj @@ -11,7 +11,7 @@ Barotrauma FakeFish, Undertow Games Barotrauma Dedicated Server - 1.0.8.0 + 1.0.9.0 Copyright © FakeFish 2018-2022 AnyCPU;x64 DedicatedServer diff --git a/Barotrauma/BarotraumaServer/WindowsServer.csproj b/Barotrauma/BarotraumaServer/WindowsServer.csproj index eaf57122e..ca4e06c19 100644 --- a/Barotrauma/BarotraumaServer/WindowsServer.csproj +++ b/Barotrauma/BarotraumaServer/WindowsServer.csproj @@ -11,7 +11,7 @@ Barotrauma FakeFish, Undertow Games Barotrauma Dedicated Server - 1.0.8.0 + 1.0.9.0 Copyright © FakeFish 2018-2022 AnyCPU;x64 DedicatedServer diff --git a/Barotrauma/BarotraumaShared/SharedSource/Items/Components/ItemContainer.cs b/Barotrauma/BarotraumaShared/SharedSource/Items/Components/ItemContainer.cs index 5a90d80a3..555611027 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/Items/Components/ItemContainer.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/Items/Components/ItemContainer.cs @@ -482,8 +482,8 @@ namespace Barotrauma.Items.Components { foreach (Item item in Inventory.AllItemsMod) { - item.ApplyStatusEffects(ActionType.OnSuccess, 1.0f, ownerCharacter); - item.ApplyStatusEffects(ActionType.OnUse, 1.0f, ownerCharacter); + item.ApplyStatusEffects(ActionType.OnSuccess, 1.0f, ownerCharacter, useTarget: ownerCharacter); + item.ApplyStatusEffects(ActionType.OnUse, 1.0f, ownerCharacter, useTarget: ownerCharacter); item.GetComponent()?.Equip(ownerCharacter); } autoInjectCooldown = AutoInjectInterval; diff --git a/Barotrauma/BarotraumaShared/SharedSource/Map/Submarine.cs b/Barotrauma/BarotraumaShared/SharedSource/Map/Submarine.cs index de5632bef..85ddf7425 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/Map/Submarine.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/Map/Submarine.cs @@ -259,7 +259,7 @@ namespace Barotrauma { if (outpost.exitPoints.Any()) { - Rectangle worldBorders = Borders; + Rectangle worldBorders = GetDockedBorders(); worldBorders.Location += WorldPosition.ToPoint(); foreach (var exitPoint in outpost.exitPoints) { @@ -425,18 +425,22 @@ namespace Barotrauma } } + private static readonly HashSet checkSubmarineBorders = new HashSet(); + /// - /// Returns a rect that contains the borders of this sub and all subs docked to it + /// Returns a rect that contains the borders of this sub and all subs docked to it, excluding outposts /// - public Rectangle GetDockedBorders(List checkd = null) + public Rectangle GetDockedBorders() { - if (checkd == null) { checkd = new List(); } - checkd.Add(this); + checkSubmarineBorders.Clear(); + return GetDockedBordersRecursive(); + } + private Rectangle GetDockedBordersRecursive() + { Rectangle dockedBorders = Borders; - - var connectedSubs = DockedTo.Where(s => !checkd.Contains(s) && !s.Info.IsOutpost).ToList(); - + checkSubmarineBorders.Add(this); + var connectedSubs = DockedTo.Where(s => !checkSubmarineBorders.Contains(s) && !s.Info.IsOutpost); foreach (Submarine dockedSub in connectedSubs) { //use docking ports instead of world position to determine @@ -445,7 +449,7 @@ namespace Barotrauma Vector2? expectedLocation = CalculateDockOffset(this, dockedSub); if (expectedLocation == null) { continue; } - Rectangle dockedSubBorders = dockedSub.GetDockedBorders(checkd); + Rectangle dockedSubBorders = dockedSub.GetDockedBordersRecursive(); dockedSubBorders.Location += MathUtils.ToPoint(expectedLocation.Value); dockedBorders.Y = -dockedBorders.Y; @@ -477,8 +481,7 @@ namespace Barotrauma { foreach (Submarine dockedSub in DockedTo) { - if (subs.Contains(dockedSub)) continue; - + if (subs.Contains(dockedSub)) { continue; } subs.Add(dockedSub); dockedSub.GetConnectedSubsRecursive(subs); } diff --git a/Barotrauma/BarotraumaShared/SharedSource/Settings/GameSettings.cs b/Barotrauma/BarotraumaShared/SharedSource/Settings/GameSettings.cs index 2c8f0353b..06e291b5b 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/Settings/GameSettings.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/Settings/GameSettings.cs @@ -52,7 +52,12 @@ namespace Barotrauma { Config config = new Config { +#if SERVER + //server defaults to English, clients get a prompt to select a language Language = TextManager.DefaultLanguage, +#else + Language = LanguageIdentifier.None, +#endif SubEditorUndoBuffer = 32, MaxAutoSaves = 8, AutoSaveIntervalSeconds = 300, @@ -100,11 +105,13 @@ namespace Barotrauma Config retVal = fallback ?? GetDefault(); retVal.DeserializeElement(element); +#if SERVER + //server defaults to English, clients get a prompt to select a language if (retVal.Language == LanguageIdentifier.None) { retVal.Language = TextManager.DefaultLanguage; } - +#endif retVal.Graphics = GraphicsSettings.FromElements(element.GetChildElements("graphicsmode", "graphicssettings"), retVal.Graphics); retVal.Audio = AudioSettings.FromElements(element.GetChildElements("audio"), retVal.Audio); #if CLIENT diff --git a/Barotrauma/BarotraumaShared/changelog.txt b/Barotrauma/BarotraumaShared/changelog.txt index 5ba2fe596..232affe74 100644 --- a/Barotrauma/BarotraumaShared/changelog.txt +++ b/Barotrauma/BarotraumaShared/changelog.txt @@ -1,3 +1,15 @@ +--------------------------------------------------------------------------------------------------------- +v1.0.9.0 +--------------------------------------------------------------------------------------------------------- + +- Fixed crashing when you move from one textbox to another using tab and go past the last available textbox. +- Fixed inability to enter the final levels on some subs that include shuttles/drones. +- Fixed autoinjectors (PUCS, autoinjector headset) wasting the syringe without any effects on the character. +- Fixed bots failing to operate turrets in Typhon 1 due to them being partially inside the ceiling. +- Fixed lights going through walls in outposts. +- Fixed language selection prompt not showing up when launching the game for the first time. +- Fixed bots doing objectives during the roles tutorial, e.g. repairing the leaks for you. + --------------------------------------------------------------------------------------------------------- v1.0.8.0 ---------------------------------------------------------------------------------------------------------