Fixed wire drop/connect bugs, fixed powertransfer signal StackOverflowException, inventory icons

This commit is contained in:
Regalis
2015-07-19 17:34:48 +03:00
parent baa207985c
commit 2dd0a60bc4
8 changed files with 88 additions and 37 deletions

View File

@@ -141,9 +141,9 @@ namespace Subsurface.Items.Components
{
base.ReceiveSignal(signal, connection, sender, power);
if (connection.Name=="signal")
if (connection.Name == "signal")
{
connection.SendSignal(signal, item, 0.0f);
connection.SendSignal(signal, sender, 0.0f);
}
}

View File

@@ -143,6 +143,7 @@ namespace Subsurface.Items.Components
Connection recipient = Wires[i].OtherConnection(this);
if (recipient == null) continue;
if (recipient.item == this.item || recipient.item == sender) continue;
foreach (ItemComponent ic in recipient.item.components)
{

View File

@@ -89,11 +89,22 @@ namespace Subsurface.Items.Components
if (connections[0] != null && connections[1] != null)
{
item.Drop(null, false);
//List<Vector2> prevNodes = new List<Vector2>(Nodes);
foreach (ItemComponent ic in item.components)
{
if (ic == this) continue;
ic.Drop(null);
}
if (item.container != null) item.container.RemoveContained(this.item);
item.body.Enabled = false;
isActive = false;
//Nodes = prevNodes;
CleanNodes();
}
@@ -114,6 +125,13 @@ namespace Subsurface.Items.Components
isActive = false;
}
public override void Drop(Character dropper)
{
ClearConnections();
isActive = false;
}
public override void Update(float deltaTime, Camera cam)
{
if (Nodes.Count == 0) return;