Wire nodes are synced when a player adds a new node and when the wire is connected to something
This commit is contained in:
@@ -228,7 +228,7 @@ namespace Barotrauma.Items.Components
|
|||||||
if (Connections[i].Wires.Contains(newWire)) continue;
|
if (Connections[i].Wires.Contains(newWire)) continue;
|
||||||
|
|
||||||
Connections[i].TryAddLink(newWire);
|
Connections[i].TryAddLink(newWire);
|
||||||
newWire.Connect(Connections[i]);
|
newWire.Connect(Connections[i], true, true);
|
||||||
|
|
||||||
var otherConnection = newWire.OtherConnection(Connections[i]);
|
var otherConnection = newWire.OtherConnection(Connections[i]);
|
||||||
|
|
||||||
|
|||||||
@@ -227,14 +227,17 @@ namespace Barotrauma.Items.Components
|
|||||||
{
|
{
|
||||||
if (character == Character.Controlled && character.SelectedConstruction != null) return false;
|
if (character == Character.Controlled && character.SelectedConstruction != null) return false;
|
||||||
|
|
||||||
if (newNodePos!= Vector2.Zero && nodes.Count>0 && Vector2.Distance(newNodePos, nodes[nodes.Count - 1]) > nodeDistance)
|
if (newNodePos != Vector2.Zero && nodes.Count > 0 && Vector2.Distance(newNodePos, nodes[nodes.Count - 1]) > nodeDistance)
|
||||||
{
|
{
|
||||||
nodes.Add(newNodePos);
|
nodes.Add(newNodePos);
|
||||||
UpdateSections();
|
UpdateSections();
|
||||||
|
|
||||||
Drawable = true;
|
Drawable = true;
|
||||||
|
|
||||||
newNodePos = Vector2.Zero;
|
newNodePos = Vector2.Zero;
|
||||||
|
|
||||||
|
if (GameMain.Server != null)
|
||||||
|
{
|
||||||
|
item.CreateServerEvent(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user