Fix mains wire light (#31066)
No idea how long this was broken; mains wire relies upon this id being accurate which means it needs doing before the calls.
This commit is contained in:
@@ -151,19 +151,17 @@ public sealed class WiresSystem : SharedWiresSystem
|
|||||||
for (var i = 0; i < enumeratedList.Count; i++)
|
for (var i = 0; i < enumeratedList.Count; i++)
|
||||||
{
|
{
|
||||||
(int id, Wire d) = enumeratedList[i];
|
(int id, Wire d) = enumeratedList[i];
|
||||||
|
d.Id = i;
|
||||||
|
|
||||||
if (d.Action != null)
|
if (d.Action != null)
|
||||||
{
|
{
|
||||||
var actionType = d.Action.GetType();
|
var actionType = d.Action.GetType();
|
||||||
if (types.ContainsKey(actionType))
|
if (!types.TryAdd(actionType, 1))
|
||||||
types[actionType] += 1;
|
types[actionType] += 1;
|
||||||
else
|
|
||||||
types.Add(actionType, 1);
|
|
||||||
|
|
||||||
if (!d.Action.AddWire(d, types[actionType]))
|
if (!d.Action.AddWire(d, types[actionType]))
|
||||||
d.Action = null;
|
d.Action = null;
|
||||||
}
|
}
|
||||||
d.Id = i;
|
|
||||||
|
|
||||||
data.Add(id, new WireLayout.WireData(d.Letter, d.Color, i));
|
data.Add(id, new WireLayout.WireData(d.Letter, d.Color, i));
|
||||||
wires.WiresList[i] = wireSet[id];
|
wires.WiresList[i] = wireSet[id];
|
||||||
|
|||||||
Reference in New Issue
Block a user