OBT/1.0.7
Fixed #7 Fixed #22/#25 Fixed a potential cause to teleport/etc stuff Added a Client counter in PM Fixed typo
This commit is contained in:
@@ -746,7 +746,6 @@ namespace Barotrauma
|
|||||||
waterFlowThisFrame = 0.0f;
|
waterFlowThisFrame = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static readonly ConcurrentBag<Hull> checkedHulls = new ConcurrentBag<Hull>();
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Simulates water flow from the source to all the hulls it's connected to across the sub, as if the water was coming directly from outside.
|
/// Simulates water flow from the source to all the hulls it's connected to across the sub, as if the water was coming directly from outside.
|
||||||
@@ -754,7 +753,7 @@ namespace Barotrauma
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
void SimulateWaterFlowFromOutsideToConnectedHulls(Hull hull, float maxFlow, float deltaTime)
|
void SimulateWaterFlowFromOutsideToConnectedHulls(Hull hull, float maxFlow, float deltaTime)
|
||||||
{
|
{
|
||||||
checkedHulls.Clear();
|
List<Hull> checkedHulls = new List<Hull>();
|
||||||
checkedHulls.Add(hull);
|
checkedHulls.Add(hull);
|
||||||
foreach (var connectedGap in hull.ConnectedGaps)
|
foreach (var connectedGap in hull.ConnectedGaps)
|
||||||
{
|
{
|
||||||
@@ -765,7 +764,7 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SimulateWaterFlowFromOutsideToConnectedHullsRecursive(Hull targetHull, Gap gap, ConcurrentBag<Hull> checkedHulls, Hull originHull, float maxFlow, float deltaTime)
|
static void SimulateWaterFlowFromOutsideToConnectedHullsRecursive(Hull targetHull, Gap gap, List<Hull> checkedHulls, Hull originHull, float maxFlow, float deltaTime)
|
||||||
{
|
{
|
||||||
const float decay = 0.95f;
|
const float decay = 0.95f;
|
||||||
|
|
||||||
@@ -996,8 +995,6 @@ namespace Barotrauma
|
|||||||
base.Remove();
|
base.Remove();
|
||||||
GapList.Remove(this);
|
GapList.Remove(this);
|
||||||
|
|
||||||
checkedHulls.Clear();
|
|
||||||
|
|
||||||
foreach (Hull hull in Hull.HullList)
|
foreach (Hull hull in Hull.HullList)
|
||||||
{
|
{
|
||||||
hull.ConnectedGaps.Remove(this);
|
hull.ConnectedGaps.Remove(this);
|
||||||
|
|||||||
@@ -655,13 +655,13 @@ namespace Barotrauma
|
|||||||
|
|
||||||
// First phase: parallel updates that have no order dependencies
|
// First phase: parallel updates that have no order dependencies
|
||||||
Parallel.Invoke(parallelOptions,
|
Parallel.Invoke(parallelOptions,
|
||||||
// Hull parallel update
|
|
||||||
() =>
|
() =>
|
||||||
{
|
{
|
||||||
Parallel.ForEach(hullList, parallelOptions, hull =>
|
// basically nothing here is thread-safe so
|
||||||
|
foreach(var hull in hullList)
|
||||||
{
|
{
|
||||||
hull.Update(deltaTime, cam);
|
hull.Update(deltaTime, cam);
|
||||||
});
|
}
|
||||||
},
|
},
|
||||||
// Structure parallel update
|
// Structure parallel update
|
||||||
() =>
|
() =>
|
||||||
|
|||||||
Reference in New Issue
Block a user