Unstable v0.9.707.0

This commit is contained in:
Juan Pablo Arce
2020-02-11 16:07:21 -03:00
parent 8324d20464
commit 2783125162
68 changed files with 1460 additions and 1219 deletions
@@ -91,7 +91,10 @@ namespace Barotrauma.Items.Components
}
existingWire.RemoveConnection(item);
item.GetComponent<ConnectionPanel>()?.DisconnectedWires.Add(existingWire);
if (existingWire.Item.ParentInventory == null)
{
item.GetComponent<ConnectionPanel>()?.DisconnectedWires.Add(existingWire);
}
if (!wires.Any(w => w.Contains(existingWire)))
{
@@ -103,8 +106,14 @@ namespace Barotrauma.Items.Components
GameServer.Log(c.Character.LogName + " disconnected a wire from " +
Connections[i].Item.Name + " (" + Connections[i].Name + ")", ServerLog.MessageType.Wiring);
if (!clientSideDisconnectedWires.Contains(existingWire))
if (existingWire.Item.ParentInventory != null)
{
//in an inventory and not connected to anything -> the wire cannot have any nodes
existingWire.ClearConnections();
}
else if (!clientSideDisconnectedWires.Contains(existingWire))
{
//not in an inventory, not connected to anything, not hanging loose from any panel -> must be dropped
existingWire.Item.Drop(c.Character);
}
}
@@ -145,7 +154,8 @@ namespace Barotrauma.Items.Components
{
if (disconnectedWire.Connections[0] == null &&
disconnectedWire.Connections[1] == null &&
!clientSideDisconnectedWires.Contains(disconnectedWire))
!clientSideDisconnectedWires.Contains(disconnectedWire) &&
disconnectedWire.Item.ParentInventory == null)
{
disconnectedWire.Item.Drop(c.Character);
GameServer.Log(c.Character.LogName + " dropped " + disconnectedWire.Name, ServerLog.MessageType.Inventory);