(31ba1cb37) Fixed batteries being able to draw power through relay components that are connected directly to a power source, even if the relay isn't on. Closes #1069

This commit is contained in:
Joonas Rikkonen
2019-03-26 14:07:51 +02:00
parent f4b85b32d0
commit d51c9a2028
@@ -140,6 +140,8 @@ namespace Barotrauma.Items.Components
if (c.Name == "power_in") continue;
foreach (Connection c2 in c.Recipients)
{
if (c2.Item.Condition <= 0.0f) { continue; }
PowerTransfer pt = c2.Item.GetComponent<PowerTransfer>();
if (pt == null)
{
@@ -151,7 +153,7 @@ namespace Barotrauma.Items.Components
}
continue;
}
if (!pt.IsActive) { continue; }
if (!pt.IsActive || !pt.CanTransfer) { continue; }
gridLoad += pt.PowerLoad;
gridPower -= pt.CurrPowerConsumption;