Fixed exceptions when creating items with a powertransfer component mid-round (e.g. when fabricating a relay component). Closes #267

This commit is contained in:
Joonas Rikkonen
2018-02-22 11:11:08 +02:00
parent e991967830
commit d87c6bd06a
@@ -174,7 +174,14 @@ namespace Barotrauma.Items.Components
var connections = item.Connections;
foreach (Connection c in connections)
{
if (!connectionDirty[c]) continue;
if (!connectionDirty.ContainsKey(c))
{
connectionDirty[c] = true;
}
else if (!connectionDirty[c])
{
continue;
}
HashSet<Connection> connected = new HashSet<Connection>();
if (!connectedRecipients.ContainsKey(c))