(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:
@@ -140,6 +140,8 @@ namespace Barotrauma.Items.Components
|
|||||||
if (c.Name == "power_in") continue;
|
if (c.Name == "power_in") continue;
|
||||||
foreach (Connection c2 in c.Recipients)
|
foreach (Connection c2 in c.Recipients)
|
||||||
{
|
{
|
||||||
|
if (c2.Item.Condition <= 0.0f) { continue; }
|
||||||
|
|
||||||
PowerTransfer pt = c2.Item.GetComponent<PowerTransfer>();
|
PowerTransfer pt = c2.Item.GetComponent<PowerTransfer>();
|
||||||
if (pt == null)
|
if (pt == null)
|
||||||
{
|
{
|
||||||
@@ -151,7 +153,7 @@ namespace Barotrauma.Items.Components
|
|||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!pt.IsActive) { continue; }
|
if (!pt.IsActive || !pt.CanTransfer) { continue; }
|
||||||
|
|
||||||
gridLoad += pt.PowerLoad;
|
gridLoad += pt.PowerLoad;
|
||||||
gridPower -= pt.CurrPowerConsumption;
|
gridPower -= pt.CurrPowerConsumption;
|
||||||
|
|||||||
Reference in New Issue
Block a user