Revert "OBT1.1.0 Merge branch 'dev_pte' into dev"
This reverts commit177cf89756, reversing changes made to42ba733cd4.
This commit is contained in:
@@ -5,7 +5,6 @@ using FarseerPhysics.Dynamics;
|
||||
using FarseerPhysics.Dynamics.Joints;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
#if CLIENT
|
||||
@@ -25,8 +24,11 @@ namespace Barotrauma.Items.Components
|
||||
Right
|
||||
}
|
||||
|
||||
private static readonly ConcurrentDictionary<DockingPort, byte> _dockingPortDict = new ConcurrentDictionary<DockingPort, byte>();
|
||||
public static IEnumerable<DockingPort> List => _dockingPortDict.Keys;
|
||||
private static readonly List<DockingPort> list = new List<DockingPort>();
|
||||
public static IEnumerable<DockingPort> List
|
||||
{
|
||||
get { return list; }
|
||||
}
|
||||
|
||||
private Sprite overlaySprite;
|
||||
private float dockingState;
|
||||
@@ -166,7 +168,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
IsActive = true;
|
||||
|
||||
_dockingPortDict.TryAdd(this, 0);
|
||||
list.Add(this);
|
||||
}
|
||||
|
||||
public override void FlipX(bool relativeToSub)
|
||||
@@ -198,7 +200,7 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
float closestDist = float.MaxValue;
|
||||
DockingPort closestPort = null;
|
||||
foreach (DockingPort port in List)
|
||||
foreach (DockingPort port in list)
|
||||
{
|
||||
if (port == this || port.item.Submarine == item.Submarine || port.IsHorizontal != IsHorizontal) { continue; }
|
||||
float xDist = Math.Abs(port.item.WorldPosition.X - item.WorldPosition.X);
|
||||
@@ -530,8 +532,8 @@ namespace Barotrauma.Items.Components
|
||||
wire.TryConnect(recipient, addNode: false);
|
||||
|
||||
//Flag connections to be updated
|
||||
Powered.MarkConnectionChanged(powerConnection);
|
||||
Powered.MarkConnectionChanged(recipient);
|
||||
Powered.ChangedConnections.Add(powerConnection);
|
||||
Powered.ChangedConnections.Add(recipient);
|
||||
}
|
||||
|
||||
private void CreateDoorBody()
|
||||
@@ -1005,7 +1007,7 @@ namespace Barotrauma.Items.Components
|
||||
Connection powerConnection = Item.Connections.Find(c => c.IsPower);
|
||||
if (powerConnection != null)
|
||||
{
|
||||
Powered.MarkConnectionChanged(powerConnection);
|
||||
Powered.ChangedConnections.Add(powerConnection);
|
||||
}
|
||||
|
||||
if (doorBody != null)
|
||||
@@ -1149,7 +1151,7 @@ namespace Barotrauma.Items.Components
|
||||
protected override void RemoveComponentSpecific()
|
||||
{
|
||||
base.RemoveComponentSpecific();
|
||||
_dockingPortDict.TryRemove(this, out _);
|
||||
list.Remove(this);
|
||||
hulls[0]?.Remove(); hulls[0] = null;
|
||||
hulls[1]?.Remove(); hulls[1] = null;
|
||||
gap?.Remove(); gap = null;
|
||||
|
||||
Reference in New Issue
Block a user