v1.0.9.0 (2nd hotfix)

This commit is contained in:
Regalis11
2023-04-12 15:42:35 +03:00
parent 5a3752a3bc
commit f8af8db91a
13 changed files with 63 additions and 39 deletions

View File

@@ -801,6 +801,7 @@ namespace Barotrauma
IEnumerable<GUITextBox> GetAndSortTextBoxes(GUIComponent parent) => parent.GetAllChildren<GUITextBox>().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())
{

View File

@@ -155,7 +155,7 @@ namespace Barotrauma.Lights
{
foreach (LightSource light in lights)
{
light.NeedsHullCheck = true;
light.HullsUpToDate.Clear();
light.NeedsRecalculation = true;
}
}

View File

@@ -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<Submarine> HullsUpToDate = new HashSet<Submarine>();
//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);
}
/// <summary>
@@ -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;

View File

@@ -6,8 +6,8 @@
<RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma</Product>
<Version>1.0.8.0</Version>
<Copyright>Copyright © FakeFish 2018-2022</Copyright>
<Version>1.0.9.0</Version>
<Copyright>Copyright © FakeFish 2018-2023</Copyright>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyName>Barotrauma</AssemblyName>
<ApplicationIcon>..\BarotraumaShared\Icon.ico</ApplicationIcon>

View File

@@ -6,8 +6,8 @@
<RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma</Product>
<Version>1.0.8.0</Version>
<Copyright>Copyright © FakeFish 2018-2022</Copyright>
<Version>1.0.9.0</Version>
<Copyright>Copyright © FakeFish 2018-2023</Copyright>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyName>Barotrauma</AssemblyName>
<ApplicationIcon>..\BarotraumaShared\Icon.ico</ApplicationIcon>

View File

@@ -6,8 +6,8 @@
<RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma</Product>
<Version>1.0.8.0</Version>
<Copyright>Copyright © FakeFish 2018-2022</Copyright>
<Version>1.0.9.0</Version>
<Copyright>Copyright © FakeFish 2018-2023</Copyright>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyName>Barotrauma</AssemblyName>
<ApplicationIcon>..\BarotraumaShared\Icon.ico</ApplicationIcon>

View File

@@ -6,8 +6,8 @@
<RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma Dedicated Server</Product>
<Version>1.0.8.0</Version>
<Copyright>Copyright © FakeFish 2018-2022</Copyright>
<Version>1.0.9.0</Version>
<Copyright>Copyright © FakeFish 2018-2023</Copyright>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyName>DedicatedServer</AssemblyName>
<ApplicationIcon>..\BarotraumaShared\Icon.ico</ApplicationIcon>

View File

@@ -6,8 +6,8 @@
<RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma Dedicated Server</Product>
<Version>1.0.8.0</Version>
<Copyright>Copyright © FakeFish 2018-2022</Copyright>
<Version>1.0.9.0</Version>
<Copyright>Copyright © FakeFish 2018-2023</Copyright>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyName>DedicatedServer</AssemblyName>
<ApplicationIcon>..\BarotraumaShared\Icon.ico</ApplicationIcon>

View File

@@ -6,8 +6,8 @@
<RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma Dedicated Server</Product>
<Version>1.0.8.0</Version>
<Copyright>Copyright © FakeFish 2018-2022</Copyright>
<Version>1.0.9.0</Version>
<Copyright>Copyright © FakeFish 2018-2023</Copyright>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyName>DedicatedServer</AssemblyName>
<ApplicationIcon>..\BarotraumaShared\Icon.ico</ApplicationIcon>

View File

@@ -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<GeneticMaterial>()?.Equip(ownerCharacter);
}
autoInjectCooldown = AutoInjectInterval;

View File

@@ -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<Submarine> checkSubmarineBorders = new HashSet<Submarine>();
/// <summary>
/// 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
/// </summary>
public Rectangle GetDockedBorders(List<Submarine> checkd = null)
public Rectangle GetDockedBorders()
{
if (checkd == null) { checkd = new List<Submarine>(); }
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);
}

View File

@@ -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

View File

@@ -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
---------------------------------------------------------------------------------------------------------