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
@@ -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;
@@ -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);
}
@@ -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