Merge branch 'dev' of https://github.com/Regalis11/Barotrauma.git into unstable-tests

This commit is contained in:
Evil Factory
2022-04-19 12:03:29 -03:00
14 changed files with 43 additions and 18 deletions
@@ -312,7 +312,7 @@ namespace Barotrauma
public void DrawForeground(SpriteBatch spriteBatch) public void DrawForeground(SpriteBatch spriteBatch)
{ {
if (Character is null || GameMain.IsSingleplayer) { return; } if (Character is null || !(GameMain.GameSession?.Campaign is MultiPlayerCampaign)) { return; }
const int million = 1000000; const int million = 1000000;
int xfraction = (int)(HUDLayoutSettings.BottomRightInfoArea.Width * 0.2f); int xfraction = (int)(HUDLayoutSettings.BottomRightInfoArea.Width * 0.2f);
int yoffset = GUI.IntScale(6); int yoffset = GUI.IntScale(6);
@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace> <RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors> <Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma</Product> <Product>Barotrauma</Product>
<Version>0.17.10.0</Version> <Version>0.17.11.0</Version>
<Copyright>Copyright © FakeFish 2018-2022</Copyright> <Copyright>Copyright © FakeFish 2018-2022</Copyright>
<Platforms>AnyCPU;x64</Platforms> <Platforms>AnyCPU;x64</Platforms>
<AssemblyName>Barotrauma</AssemblyName> <AssemblyName>Barotrauma</AssemblyName>
+1 -1
View File
@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace> <RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors> <Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma</Product> <Product>Barotrauma</Product>
<Version>0.17.10.0</Version> <Version>0.17.11.0</Version>
<Copyright>Copyright © FakeFish 2018-2022</Copyright> <Copyright>Copyright © FakeFish 2018-2022</Copyright>
<Platforms>AnyCPU;x64</Platforms> <Platforms>AnyCPU;x64</Platforms>
<AssemblyName>Barotrauma</AssemblyName> <AssemblyName>Barotrauma</AssemblyName>
@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace> <RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors> <Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma</Product> <Product>Barotrauma</Product>
<Version>0.17.10.0</Version> <Version>0.17.11.0</Version>
<Copyright>Copyright © FakeFish 2018-2022</Copyright> <Copyright>Copyright © FakeFish 2018-2022</Copyright>
<Platforms>AnyCPU;x64</Platforms> <Platforms>AnyCPU;x64</Platforms>
<AssemblyName>Barotrauma</AssemblyName> <AssemblyName>Barotrauma</AssemblyName>
@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace> <RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors> <Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma Dedicated Server</Product> <Product>Barotrauma Dedicated Server</Product>
<Version>0.17.10.0</Version> <Version>0.17.11.0</Version>
<Copyright>Copyright © FakeFish 2018-2022</Copyright> <Copyright>Copyright © FakeFish 2018-2022</Copyright>
<Platforms>AnyCPU;x64</Platforms> <Platforms>AnyCPU;x64</Platforms>
<AssemblyName>DedicatedServer</AssemblyName> <AssemblyName>DedicatedServer</AssemblyName>
+1 -1
View File
@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace> <RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors> <Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma Dedicated Server</Product> <Product>Barotrauma Dedicated Server</Product>
<Version>0.17.10.0</Version> <Version>0.17.11.0</Version>
<Copyright>Copyright © FakeFish 2018-2022</Copyright> <Copyright>Copyright © FakeFish 2018-2022</Copyright>
<Platforms>AnyCPU;x64</Platforms> <Platforms>AnyCPU;x64</Platforms>
<AssemblyName>DedicatedServer</AssemblyName> <AssemblyName>DedicatedServer</AssemblyName>
@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace> <RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors> <Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma Dedicated Server</Product> <Product>Barotrauma Dedicated Server</Product>
<Version>0.17.10.0</Version> <Version>0.17.11.0</Version>
<Copyright>Copyright © FakeFish 2018-2022</Copyright> <Copyright>Copyright © FakeFish 2018-2022</Copyright>
<Platforms>AnyCPU;x64</Platforms> <Platforms>AnyCPU;x64</Platforms>
<AssemblyName>DedicatedServer</AssemblyName> <AssemblyName>DedicatedServer</AssemblyName>
@@ -341,7 +341,7 @@ namespace Barotrauma
if (levelData.HasBeaconStation && !levelData.IsBeaconActive) if (levelData.HasBeaconStation && !levelData.IsBeaconActive)
{ {
var beaconMissionPrefabs = MissionPrefab.Prefabs.Where(m => m.Tags.Any(t => t.Equals("beaconnoreward", StringComparison.OrdinalIgnoreCase))); var beaconMissionPrefabs = MissionPrefab.Prefabs.Where(m => m.Tags.Any(t => t.Equals("beaconnoreward", StringComparison.OrdinalIgnoreCase))).OrderBy(m => m.UintIdentifier);
if (beaconMissionPrefabs.Any()) if (beaconMissionPrefabs.Any())
{ {
Random rand = new MTRandom(ToolBox.StringToInt(levelData.Seed)); Random rand = new MTRandom(ToolBox.StringToInt(levelData.Seed));
@@ -354,7 +354,7 @@ namespace Barotrauma
} }
if (levelData.HasHuntingGrounds) if (levelData.HasHuntingGrounds)
{ {
var huntingGroundsMissionPrefabs = MissionPrefab.Prefabs.Where(m => m.Tags.Any(t => t.Equals("huntinggrounds", StringComparison.OrdinalIgnoreCase))); var huntingGroundsMissionPrefabs = MissionPrefab.Prefabs.Where(m => m.Tags.Any(t => t.Equals("huntinggrounds", StringComparison.OrdinalIgnoreCase))).OrderBy(m => m.UintIdentifier);
if (!huntingGroundsMissionPrefabs.Any()) if (!huntingGroundsMissionPrefabs.Any())
{ {
DebugConsole.AddWarning("Could not find a hunting grounds mission for the level. No mission with the tag \"huntinggrounds\" found."); DebugConsole.AddWarning("Could not find a hunting grounds mission for the level. No mission with the tag \"huntinggrounds\" found.");
@@ -397,11 +397,6 @@ namespace Barotrauma.Items.Components
//Only add valid connections //Only add valid connections
if (otherC.Grid != grid && (otherC.Grid == null || !Grids.ContainsKey(otherC.Grid.ID)) && ValidPowerConnection(c, otherC)) if (otherC.Grid != grid && (otherC.Grid == null || !Grids.ContainsKey(otherC.Grid.ID)) && ValidPowerConnection(c, otherC))
{ {
if (otherC.Item.Condition <= 0.0f)
{
continue;
}
otherC.Grid = grid; //Assigning ID early prevents unncessary adding to stack otherC.Grid = grid; //Assigning ID early prevents unncessary adding to stack
probeStack.Push(otherC); probeStack.Push(otherC);
} }
@@ -665,7 +660,10 @@ namespace Barotrauma.Items.Components
public static bool ValidPowerConnection(Connection conn1, Connection conn2) public static bool ValidPowerConnection(Connection conn1, Connection conn2)
{ {
return conn1.IsPower && conn2.IsPower && (conn1.Item.HasTag("junctionbox") || conn2.Item.HasTag("junctionbox") || conn1.Item.HasTag("dock") || conn2.Item.HasTag("dock") || conn1.IsOutput != conn2.IsOutput); return
conn1.IsPower && conn2.IsPower &&
conn1.Item.Condition > 0.0f && conn2.Item.Condition > 0.0f &&
(conn1.Item.HasTag("junctionbox") || conn2.Item.HasTag("junctionbox") || conn1.Item.HasTag("dock") || conn2.Item.HasTag("dock") || conn1.IsOutput != conn2.IsOutput);
} }
/// <summary> /// <summary>
@@ -141,7 +141,7 @@ namespace Barotrauma.Items.Components
ApplyStatusEffects(ActionType.OnActive, deltaTime, null); ApplyStatusEffects(ActionType.OnActive, deltaTime, null);
if (Voltage > OverloadVoltage && CanBeOverloaded) if (Voltage > OverloadVoltage && CanBeOverloaded && item.Repairables.Any())
{ {
item.Condition = 0.0f; item.Condition = 0.0f;
} }
@@ -957,7 +957,18 @@ namespace Barotrauma
public PriceInfo GetPriceInfo(Location.StoreInfo store) public PriceInfo GetPriceInfo(Location.StoreInfo store)
{ {
if (!store.Identifier.IsEmpty && StorePrices != null && StorePrices.TryGetValue(store.Identifier, out var storePriceInfo)) if (store == null)
{
string message = $"Tried to get price info for \"{Identifier}\" with a null store parameter!\n{Environment.StackTrace.CleanupStackTrace()}";
#if DEBUG
DebugConsole.ShowError(message);
#else
DebugConsole.AddWarning(message);
GameAnalyticsManager.AddErrorEventOnce("ItemPrefab.GetPriceInfo:StoreParameterNull", GameAnalyticsManager.ErrorSeverity.Error, message);
#endif
return null;
}
else if (!store.Identifier.IsEmpty && StorePrices != null && StorePrices.TryGetValue(store.Identifier, out var storePriceInfo))
{ {
return storePriceInfo; return storePriceInfo;
} }
@@ -153,7 +153,10 @@ namespace Barotrauma
{ {
Name = TextManager.GetWithVariable("wreckeditemformat", "[name]", Name); Name = TextManager.GetWithVariable("wreckeditemformat", "[name]", Name);
} }
Name = Name.Fallback(OriginalName); if (!string.IsNullOrEmpty(OriginalName))
{
Name = Name.Fallback(OriginalName);
}
var tags = new HashSet<Identifier>(); var tags = new HashSet<Identifier>();
string joinedTags = element.GetAttributeString("tags", ""); string joinedTags = element.GetAttributeString("tags", "");
@@ -1229,6 +1229,7 @@ namespace Barotrauma
{ {
if (!connectedSubs.Contains(item.Submarine)) { continue; } if (!connectedSubs.Contains(item.Submarine)) { continue; }
if (!item.HasTag("cargocontainer")) { continue; } if (!item.HasTag("cargocontainer")) { continue; }
if (item.NonInteractable || item.HiddenInGame) { continue; }
var itemContainer = item.GetComponent<ItemContainer>(); var itemContainer = item.GetComponent<ItemContainer>();
if (itemContainer == null) { continue; } if (itemContainer == null) { continue; }
int emptySlots = 0; int emptySlots = 0;
+12
View File
@@ -1,3 +1,15 @@
---------------------------------------------------------------------------------------------------------
v0.17.11.0
---------------------------------------------------------------------------------------------------------
Fixes:
- Fixed occasional crash when talking to an outpost merchant.
- Fixed cargo missions putting cargo in non-interactable and hidden-in-game containers.
- Don't show wallet info on character portrait in other multiplayer game modes than the campaign.
- Fixed certainstructure names not showing up properly in the submarine editor in languages other than English.
- Fixed relays that have "can be overloaded" set to true breaking when overloaded (should never happen because relays can't be repaired).
- Fixed occasional mission mismatch errors in multiplayer when there's a hunting grounds or beacon mission in the level.
--------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------
v0.17.10.0 v0.17.10.0
--------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------