Release 1.10.6.0 - Autumn Update 2025 Hotfix 1
This commit is contained in:
@@ -59,6 +59,8 @@ namespace Barotrauma
|
||||
private float higherSurface;
|
||||
private float lowerSurface;
|
||||
|
||||
private float waterFlowThisFrame;
|
||||
|
||||
private Vector2 lerpedFlowForce;
|
||||
|
||||
//if set to true, hull connections of this gap won't be updated when changes are being done to hulls
|
||||
@@ -503,6 +505,7 @@ namespace Barotrauma
|
||||
delta = Math.Min(delta, hull1.Volume * Hull.MaxCompress - hull1.WaterVolume);
|
||||
hull1.WaterVolume += delta;
|
||||
hull2.WaterVolume -= delta;
|
||||
waterFlowThisFrame += delta;
|
||||
if (hull1.WaterVolume > hull1.Volume)
|
||||
{
|
||||
hull1.Pressure = Math.Max(hull1.Pressure, (hull1.Pressure + hull2.Pressure+subOffset.Y) / 2);
|
||||
@@ -529,7 +532,7 @@ namespace Barotrauma
|
||||
{
|
||||
hull2.Pressure = Math.Max(hull2.Pressure, ((hull1.Pressure-subOffset.Y) + hull2.Pressure) / 2);
|
||||
}
|
||||
|
||||
waterFlowThisFrame += delta;
|
||||
flowForce = new Vector2(delta * (float)(Timing.Step / deltaTime), 0.0f);
|
||||
}
|
||||
|
||||
@@ -569,6 +572,7 @@ namespace Barotrauma
|
||||
delta = Math.Max(delta, 0.0f);
|
||||
hull1.WaterVolume += delta;
|
||||
hull2.WaterVolume -= delta;
|
||||
waterFlowThisFrame += delta;
|
||||
|
||||
flowForce = new Vector2(
|
||||
0.0f,
|
||||
@@ -597,6 +601,7 @@ namespace Barotrauma
|
||||
}
|
||||
hull1.WaterVolume -= delta;
|
||||
hull2.WaterVolume += delta;
|
||||
waterFlowThisFrame += delta;
|
||||
|
||||
flowForce = new Vector2(
|
||||
hull1.WaveY[hull1.GetWaveIndex(rect.X)] - hull1.WaveY[hull1.GetWaveIndex(rect.Right)],
|
||||
@@ -734,6 +739,11 @@ namespace Barotrauma
|
||||
return (linkedTo[0] == hull1 ? linkedTo[1] : linkedTo[0]) as Hull;
|
||||
}
|
||||
|
||||
public void ResetWaterFlowThisFrame()
|
||||
{
|
||||
waterFlowThisFrame = 0.0f;
|
||||
}
|
||||
|
||||
private static readonly HashSet<Hull> checkedHulls = new HashSet<Hull>();
|
||||
|
||||
/// <summary>
|
||||
@@ -758,10 +768,24 @@ namespace Barotrauma
|
||||
const float decay = 0.95f;
|
||||
|
||||
maxFlow = Math.Min(maxFlow, gap.GetWaterFlowFromOutside(targetHull, deltaTime, ignoreCurrentWater: true)) * decay;
|
||||
|
||||
//if the hulls are not linked (i.e. not parts of the same room), limit the flow a bit
|
||||
var sourceHull = gap.GetOtherLinkedHull(targetHull);
|
||||
if (sourceHull != null && !sourceHull.linkedTo.Contains(targetHull))
|
||||
{
|
||||
maxFlow *= 0.5f;
|
||||
}
|
||||
|
||||
//take the amount of water that has already passed through this gap into account
|
||||
//(if there's multiple leaks to the outside recursively passing water through the same gap, the flow should not go above the maximum flow through this gap)
|
||||
maxFlow -= gap.waterFlowThisFrame;
|
||||
|
||||
if (maxFlow <= 0.001f) { return; }
|
||||
|
||||
checkedHulls.Add(targetHull);
|
||||
|
||||
gap.waterFlowThisFrame += maxFlow;
|
||||
|
||||
//don't multiply by deltatime here, we already did that in GetWaterFlowFromOutside
|
||||
targetHull.WaterVolume += maxFlow;
|
||||
//lerp lethal pressure up very fast
|
||||
|
||||
Reference in New Issue
Block a user