Build 0.21.6.0 (1.0 pre-patch)

This commit is contained in:
Regalis11
2023-01-31 18:08:26 +02:00
parent e1c04bc31d
commit cf9ecd35b3
231 changed files with 4479 additions and 2276 deletions
@@ -531,11 +531,15 @@ namespace Barotrauma
/// <summary>
/// Calculated from <see cref="SubmarineElement"/>. Can be used when the sub hasn't been loaded and we can't access <see cref="Submarine.RealWorldCrushDepth"/>.
/// </summary>
public float GetRealWorldCrushDepth()
public bool IsCrushDepthDefinedInStructures(out float realWorldCrushDepth)
{
if (SubmarineElement == null) { return Level.DefaultRealWorldCrushDepth; }
if (SubmarineElement == null)
{
realWorldCrushDepth = Level.DefaultRealWorldCrushDepth;
return false;
}
bool structureCrushDepthsDefined = false;
float realWorldCrushDepth = float.PositiveInfinity;
realWorldCrushDepth = float.PositiveInfinity;
foreach (var structureElement in SubmarineElement.GetChildElements("structure"))
{
string name = structureElement.Attribute("name")?.Value ?? "";
@@ -553,7 +557,7 @@ namespace Barotrauma
{
realWorldCrushDepth = Level.DefaultRealWorldCrushDepth;
}
return realWorldCrushDepth;
return structureCrushDepthsDefined;
}
//saving/loading ----------------------------------------------------