2f107db...5202af9
This commit is contained in:
@@ -1416,15 +1416,15 @@ namespace Barotrauma
|
||||
{
|
||||
wall.Update(deltaTime);
|
||||
}
|
||||
|
||||
if (GameMain.Server != null)
|
||||
|
||||
if (GameMain.NetworkMember != null && GameMain.NetworkMember.IsServer)
|
||||
{
|
||||
networkUpdateTimer += deltaTime;
|
||||
if (networkUpdateTimer > NetworkUpdateInterval)
|
||||
{
|
||||
if (extraWalls.Any(w => w.Body.BodyType != BodyType.Static))
|
||||
{
|
||||
GameMain.Server.CreateEntityEvent(this);
|
||||
GameMain.NetworkMember.CreateEntityEvent(this);
|
||||
}
|
||||
networkUpdateTimer = 0.0f;
|
||||
}
|
||||
|
||||
@@ -346,7 +346,9 @@ namespace Barotrauma
|
||||
public Sprite BackgroundSprite { get; private set; }
|
||||
public Sprite BackgroundTopSprite { get; private set; }
|
||||
public Sprite WallSprite { get; private set; }
|
||||
public Sprite WallSpriteSpecular { get; private set; }
|
||||
public Sprite WallEdgeSprite { get; private set; }
|
||||
public Sprite WallEdgeSpriteSpecular { get; private set; }
|
||||
public Sprite WaterParticles { get; private set; }
|
||||
|
||||
public static List<Biome> GetBiomes()
|
||||
@@ -419,9 +421,15 @@ namespace Barotrauma
|
||||
case "wall":
|
||||
WallSprite = new Sprite(subElement);
|
||||
break;
|
||||
case "wallspecular":
|
||||
WallSpriteSpecular = new Sprite(subElement);
|
||||
break;
|
||||
case "walledge":
|
||||
WallEdgeSprite = new Sprite(subElement);
|
||||
break;
|
||||
case "walledgespecular":
|
||||
WallEdgeSpriteSpecular = new Sprite(subElement);
|
||||
break;
|
||||
case "waterparticles":
|
||||
WaterParticles = new Sprite(subElement);
|
||||
break;
|
||||
|
||||
@@ -14,6 +14,9 @@ namespace Barotrauma
|
||||
public readonly LevelObjectPrefab Prefab;
|
||||
public Vector3 Position;
|
||||
|
||||
public float NetworkUpdateTimer;
|
||||
public const float NetworkUpdateInterval = 0.2f;
|
||||
|
||||
public float Scale;
|
||||
|
||||
public float Rotation;
|
||||
|
||||
@@ -336,12 +336,14 @@ namespace Barotrauma
|
||||
{
|
||||
foreach (LevelObject obj in objects)
|
||||
{
|
||||
if (GameMain.Server != null)
|
||||
if (GameMain.NetworkMember != null && GameMain.NetworkMember.IsServer)
|
||||
{
|
||||
if (obj.NeedsNetworkSyncing)
|
||||
obj.NetworkUpdateTimer -= deltaTime;
|
||||
if (obj.NeedsNetworkSyncing && obj.NetworkUpdateTimer <= 0.0f)
|
||||
{
|
||||
GameMain.Server.CreateEntityEvent(this, new object[] { obj });
|
||||
GameMain.NetworkMember.CreateEntityEvent(this, new object[] { obj });
|
||||
obj.NeedsNetworkSyncing = false;
|
||||
obj.NetworkUpdateTimer = LevelObject.NetworkUpdateInterval;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -279,6 +279,9 @@ namespace Barotrauma
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
forceFluctuationTimer = Rand.Range(0.0f, ForceFluctuationInterval);
|
||||
randomTriggerTimer = Rand.Range(0.0f, randomTriggerInterval);
|
||||
}
|
||||
|
||||
private void UpdateCollisionCategories()
|
||||
@@ -420,7 +423,12 @@ namespace Barotrauma
|
||||
|
||||
triggerers.RemoveWhere(t => t.Removed);
|
||||
|
||||
if (!UseNetworkSyncing || GameMain.Client == null)
|
||||
bool isNotClient = true;
|
||||
#if CLIENT
|
||||
isNotClient = GameMain.Client == null;
|
||||
#endif
|
||||
|
||||
if (!UseNetworkSyncing || isNotClient)
|
||||
{
|
||||
if (ForceFluctuationStrength > 0.0f)
|
||||
{
|
||||
|
||||
@@ -636,14 +636,13 @@ namespace Barotrauma.RuinGeneration
|
||||
foreach (RuinEntity ruinEntity in ruinEntities)
|
||||
{
|
||||
CreateConnections(ruinEntity);
|
||||
ruinEntity.Entity.ParentRuin = this;
|
||||
}
|
||||
|
||||
foreach (RuinEntity ruinEntity in ruinEntities)
|
||||
{
|
||||
if (ruinEntity.Entity is Item item)
|
||||
{
|
||||
foreach (ItemComponent ic in item.components)
|
||||
foreach (ItemComponent ic in item.Components)
|
||||
{
|
||||
// Prevent wiring & interacting
|
||||
if (ic is ConnectionPanel connectionPanel)
|
||||
@@ -737,6 +736,11 @@ namespace Barotrauma.RuinGeneration
|
||||
}
|
||||
}
|
||||
|
||||
foreach (RuinEntity ruinEntity in ruinEntities)
|
||||
{
|
||||
ruinEntity.Entity.ParentRuin = this;
|
||||
}
|
||||
|
||||
bool hullXIntersect(Rectangle rect1, Rectangle rect2)
|
||||
{
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user