Fixed wire drop/connect bugs, fixed powertransfer signal StackOverflowException, inventory icons
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user