All Powered components of an item are taken into account in grid power/load calculations, not just the first one

This commit is contained in:
Regalis
2017-05-30 17:04:14 +03:00
parent 7910b13120
commit 4651e666bf
@@ -127,7 +127,8 @@ namespace Barotrauma.Items.Components
if (it.Condition <= 0.0f) continue; if (it.Condition <= 0.0f) continue;
Powered powered = it.GetComponent<Powered>(); foreach (Powered powered in it.GetComponents<Powered>())
{
if (powered == null || !powered.IsActive) continue; if (powered == null || !powered.IsActive) continue;
if (connectedList.Contains(powered)) continue; if (connectedList.Contains(powered)) continue;
@@ -167,6 +168,8 @@ namespace Barotrauma.Items.Components
} }
} }
} }
}
} }
} }