- fixed light components throwing errors when receiving an invalid color value to the "set_color" input
- fixed it being possible to connect wires to more than two items by selecting another item while dragging the wire - relay components break if too much power is directed through them - relay components are active by default and the can be toggled on/off in the editor - bool properties show as checkboxes in the editor
This commit is contained in:
@@ -333,30 +333,16 @@ namespace Barotrauma.Items.Components
|
||||
int index = FindWireIndex(null);
|
||||
|
||||
Wire wireComponent = draggingConnected.GetComponent<Wire>();
|
||||
|
||||
if (index>-1 && wireComponent!=null && !Wires.Contains(wireComponent))
|
||||
|
||||
if (index > -1 && wireComponent != null && !Wires.Contains(wireComponent))
|
||||
{
|
||||
bool alreadyConnected = wireComponent.IsConnectedTo(item);
|
||||
|
||||
wireComponent.RemoveConnection(item);
|
||||
|
||||
Wires[index] = wireComponent;
|
||||
wireComponent.Connect(this, !alreadyConnected);
|
||||
if (wireComponent.Connect(this, !alreadyConnected)) Wires[index] = wireComponent;
|
||||
}
|
||||
}
|
||||
//far away -> disconnect if the wire is linked to this connector
|
||||
else
|
||||
{
|
||||
//int index = FindWireIndex(draggingConnected);
|
||||
//if (index>-1)
|
||||
//{
|
||||
// Wires[index].RemoveConnection(this);
|
||||
// //Wires[index].Item.SetTransform(item.SimPosition, 0.0f);
|
||||
// //Wires[index].Item.Drop();
|
||||
// //Wires[index].Item.body.Enabled = true;
|
||||
// Wires[index] = null;
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int screwIndex = (position.Y % 60 < 30) ? 0 : 1;
|
||||
|
||||
Reference in New Issue
Block a user