Release 1.9.7.0 - Summer Update 2025
This commit is contained in:
@@ -30,8 +30,8 @@ namespace Barotrauma
|
||||
//don't create updates if all clients are very far from the hull
|
||||
float hullUpdateDistanceSqr = NetConfig.HullUpdateDistance * NetConfig.HullUpdateDistance;
|
||||
if (!GameMain.Server.ConnectedClients.Any(c =>
|
||||
c.Character != null &&
|
||||
Vector2.DistanceSquared(c.Character.WorldPosition, WorldPosition) < hullUpdateDistanceSqr))
|
||||
(c.Character != null && Vector2.DistanceSquared(c.Character.WorldPosition, WorldPosition) < hullUpdateDistanceSqr) ||
|
||||
(c.SpectatePos != null && Vector2.DistanceSquared(c.SpectatePos.Value, WorldPosition) < hullUpdateDistanceSqr)) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -76,6 +76,11 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
public void ForceStatusUpdate()
|
||||
{
|
||||
statusUpdateTimer = NetConfig.SparseHullUpdateInterval;
|
||||
}
|
||||
|
||||
|
||||
public void CreateStatusEvent()
|
||||
{
|
||||
@@ -137,6 +142,12 @@ namespace Barotrauma
|
||||
|
||||
WaterVolume = newWaterVolume;
|
||||
|
||||
if (newFireSources.Length != FireSources.Count)
|
||||
{
|
||||
//number of fire sources has changed, force a network update
|
||||
ForceStatusUpdate();
|
||||
}
|
||||
|
||||
for (int i = 0; i < newFireSources.Length; i++)
|
||||
{
|
||||
Vector2 pos = newFireSources[i].Position;
|
||||
|
||||
Reference in New Issue
Block a user