Unstable 0.15.22.0

This commit is contained in:
Markus Isberg
2021-12-17 00:19:56 +09:00
parent 7d43cb1e91
commit a864a98d4f
16 changed files with 78 additions and 33 deletions

View File

@@ -660,17 +660,17 @@ namespace Barotrauma
GUITickBox vsyncTickBox = new GUITickBox(new RectTransform(tickBoxScale, leftColumn.RectTransform), TextManager.Get("EnableVSync"))
{
ToolTip = TextManager.Get("EnableVSyncToolTip"),
OnSelected = (GUITickBox box) =>
{
VSyncEnabled = box.Selected;
GameMain.GraphicsDeviceManager.SynchronizeWithVerticalRetrace = VSyncEnabled;
GameMain.GraphicsDeviceManager.ApplyChanges();
UnsavedSettings = true;
return true;
},
Selected = VSyncEnabled
};
vsyncTickBox.OnSelected = (GUITickBox box) =>
{
VSyncEnabled = box.Selected;
GameMain.GraphicsDeviceManager.SynchronizeWithVerticalRetrace = VSyncEnabled;
GameMain.GraphicsDeviceManager.ApplyChanges();
UnsavedSettings = true;
return true;
};
GUITickBox textureCompressionTickBox = new GUITickBox(new RectTransform(tickBoxScale, leftColumn.RectTransform), TextManager.Get("EnableTextureCompression"))
@@ -1456,6 +1456,7 @@ namespace Barotrauma
Step = 0.01f
};
textScaleScrollBar.OnMoved(textScaleScrollBar, textScaleScrollBar.BarScroll);
textScaleDirty = false;
/// Bottom buttons -------------------------------------------------------------
new GUIButton(new RectTransform(new Vector2(0.3f, 1.0f), buttonArea.RectTransform, Anchor.BottomLeft),

View File

@@ -710,7 +710,7 @@ namespace Barotrauma.Items.Components
if (item.CurrentHull is { } currentHull && currentHull == hull)
{
Sprite pingCircle = GUI.Style.YouAreHereCircle.Sprite;
Sprite? pingCircle = GUI.Style.YouAreHereCircle?.Sprite;
if (pingCircle is null) { continue; }
Vector2 charPos = item.WorldPosition;

View File

@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma</Product>
<Version>0.15.21.0</Version>
<Version>0.15.22.0</Version>
<Copyright>Copyright © FakeFish 2018-2020</Copyright>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyName>Barotrauma</AssemblyName>

View File

@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma</Product>
<Version>0.15.21.0</Version>
<Version>0.15.22.0</Version>
<Copyright>Copyright © FakeFish 2018-2020</Copyright>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyName>Barotrauma</AssemblyName>

View File

@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma</Product>
<Version>0.15.21.0</Version>
<Version>0.15.22.0</Version>
<Copyright>Copyright © FakeFish 2018-2020</Copyright>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyName>Barotrauma</AssemblyName>

View File

@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma Dedicated Server</Product>
<Version>0.15.21.0</Version>
<Version>0.15.22.0</Version>
<Copyright>Copyright © FakeFish 2018-2020</Copyright>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyName>DedicatedServer</AssemblyName>

View File

@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma Dedicated Server</Product>
<Version>0.15.21.0</Version>
<Version>0.15.22.0</Version>
<Copyright>Copyright © FakeFish 2018-2020</Copyright>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyName>DedicatedServer</AssemblyName>

View File

@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma Dedicated Server</Product>
<Version>0.15.21.0</Version>
<Version>0.15.22.0</Version>
<Copyright>Copyright © FakeFish 2018-2020</Copyright>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyName>DedicatedServer</AssemblyName>

View File

@@ -18,7 +18,7 @@ namespace Barotrauma.Abilities
{
if (abilityObject is AbilitySkillGain abilitySkillGain)
{
if (ignoreAbilitySkillGain && !abilitySkillGain.GainedFromAbility) { return; }
if (ignoreAbilitySkillGain && abilitySkillGain.GainedFromAbility) { return; }
Character.Info?.IncreaseSkillLevel(skillIdentifier, abilitySkillGain.Value, gainedFromAbility: true);
}
else

View File

@@ -17,7 +17,7 @@ namespace Barotrauma.Abilities
{
if (abilityObject is AbilitySkillGain abilitySkillGain && abilitySkillGain.Character != Character)
{
if (ignoreAbilitySkillGain && !abilitySkillGain.GainedFromAbility) { return; }
if (ignoreAbilitySkillGain && abilitySkillGain.GainedFromAbility) { return; }
Character.Info?.IncreaseSkillLevel(abilitySkillGain.String, 1.0f, gainedFromAbility: true);
}
}

View File

@@ -2341,10 +2341,11 @@ namespace Barotrauma
}
if (e.InnerException != null)
{
error += "\n\nInner exception: " + e.InnerException.Message + "\n";
if (e.InnerException.StackTrace != null)
var innermost = e.GetInnermost();
error += "\n\nInner exception: " + innermost.Message + "\n";
if (innermost.StackTrace != null)
{
error += e.InnerException.StackTrace.CleanupStackTrace(); ;
error += innermost.StackTrace.CleanupStackTrace(); ;
}
}
}

View File

@@ -203,12 +203,26 @@ namespace Barotrauma
private readonly Action? onQuit;
private void OnQuit()
{
if (assembly != null) { onQuit?.Invoke(); }
try
{
if (assembly != null) { onQuit?.Invoke(); }
}
catch (Exception e)
{
e = e.GetInnermost();
DebugConsole.AddWarning($"Failed to call GameAnalytics.OnQuit: {e.Message} {e.StackTrace}");
//If this happens then GameAnalytics is just broken,
//let's just hope that it uninitialized correctly and
//allow the game to keep running
}
}
public void Dispose()
{
if (loadContext is null) { return; }
OnQuit();
loadContext?.Unload();
loadContext = null;

View File

@@ -280,10 +280,7 @@ namespace Barotrauma.Items.Components
{
foreach (Item subItem in containedItem.ContainedItems.ToList())
{
if (subItem.Combine(spawnedItem, null))
{
break;
}
if (subItem.Combine(spawnedItem, null)) { break; }
}
}
else if (containedItem?.Combine(spawnedItem, null) ?? false)
@@ -302,12 +299,9 @@ namespace Barotrauma.Items.Components
foreach (ItemContainer ic in targetItem.GetComponents<ItemContainer>())
{
if (ic?.Inventory == null || ic.RemoveContainedItemsOnDeconstruct) { continue; }
foreach (Item containedItem in ic.Inventory.AllItemsMod)
foreach (Item outputItem in ic.Inventory.AllItemsMod)
{
if (!outputContainer.Inventory.TryPutItem(containedItem, user: null))
{
containedItem.Drop(dropper: null);
}
tryPutInOutputSlots(outputItem);
}
}
inputContainer.Inventory.RemoveItem(targetItem);
@@ -317,13 +311,29 @@ namespace Barotrauma.Items.Components
}
else
{
if (!outputContainer.Inventory.CanBePut(targetItem) || (Entity.Spawner?.IsInRemoveQueue(targetItem) ?? false))
if (Entity.Spawner?.IsInRemoveQueue(targetItem) ?? false)
{
targetItem.Drop(dropper: null);
}
else
{
outputContainer.Inventory.TryPutItem(targetItem, user: null, createNetworkEvent: true);
tryPutInOutputSlots(targetItem);
}
}
void tryPutInOutputSlots(Item item)
{
for (int i = 0; i < outputContainer.Capacity; i++)
{
var containedItem = outputContainer.Inventory.GetItemAt(i);
if (containedItem?.OwnInventory != null && containedItem.OwnInventory.TryPutItem(item, user: null))
{
return;
}
}
if (!outputContainer.Inventory.TryPutItem(item, user: null))
{
item.Drop(dropper: null);
}
}
}

View File

@@ -704,5 +704,12 @@ namespace Barotrauma
Point topLeft = new Point(center.X - halfSize.X, center.Y + halfSize.Y);
return new Rectangle(topLeft, size);
}
public static Exception GetInnermost(this Exception e)
{
while (e.InnerException != null) { e = e.InnerException; }
return e;
}
}
}

View File

@@ -1,3 +1,15 @@
---------------------------------------------------------------------------------------------------------
v0.15.22.0
---------------------------------------------------------------------------------------------------------
- Fixed crashing on startup on some versions of macOS.
- Fixed GameAnalytics consent prompt going outside the window on small resolutions and/or large text sizes.
- Fixed Kastrull's drone sometimes spawning inside the sub client-side in multiplayer.
- Fixed opening the settings menu resetting the game window, which caused screen capture software to stop capturing the window.
- Fixed certain mods that don't configure the "you are here" circle sprite for the status monitors causing crashes.
- Fixed abilities that give simultaneous skill gain (minor in mechanics, once upon a time in europa, apprenticeship) not giving the extra skill points.
- Fixed deconstructor not being able to put the items into containers in the output slots.
---------------------------------------------------------------------------------------------------------
v0.15.21.0
---------------------------------------------------------------------------------------------------------