(c224aa4f4) Refresh the size of the linked gap when a door's scale is changed

This commit is contained in:
Joonas Rikkonen
2019-06-14 16:15:00 +03:00
parent d08132afc5
commit c76ae7612d
4 changed files with 32 additions and 8 deletions
@@ -207,20 +207,22 @@ namespace Barotrauma
//clone links between the entities
for (int i = 0; i < clones.Count; i++)
{
if (entitiesToClone[i].linkedTo == null) continue;
if (entitiesToClone[i].linkedTo == null) { continue; }
foreach (MapEntity linked in entitiesToClone[i].linkedTo)
{
if (!entitiesToClone.Contains(linked)) continue;
if (!entitiesToClone.Contains(linked)) { continue; }
clones[i].linkedTo.Add(clones[entitiesToClone.IndexOf(linked)]);
}
}
//connect clone wires to the clone items
//connect clone wires to the clone items and refresh links between doors and gaps
for (int i = 0; i < clones.Count; i++)
{
var cloneItem = clones[i] as Item;
if (cloneItem == null) continue;
if (cloneItem == null) { continue; }
var door = cloneItem.GetComponent<Door>();
if (door != null) { door.RefreshLinkedGap(); }
var cloneWire = cloneItem.GetComponent<Wire>();
if (cloneWire == null) continue;
@@ -231,7 +233,7 @@ namespace Barotrauma
for (int n = 0; n < 2; n++)
{
if (originalWire.Connections[n] == null) continue;
if (originalWire.Connections[n] == null) { continue; }
var connectedItem = originalWire.Connections[n].Item;
if (connectedItem == null) continue;