Wire nodes are synced when a player adds a new node and when the wire is connected to something

This commit is contained in:
Joonas Rikkonen
2017-07-25 23:27:30 +03:00
parent 431e5bb9b8
commit f062ca0e4d
2 changed files with 7 additions and 4 deletions
@@ -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]);
@@ -231,10 +231,13 @@ namespace Barotrauma.Items.Components
{ {
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;
} }