(4ddf8b0b2) Fixed power not working correctly in some grids with chained relays and junction boxes. Closes #1385
This commit is contained in:
@@ -354,11 +354,12 @@ namespace Barotrauma.Items.Components
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!powerTransfer.CanTransfer) continue;
|
if (!powerTransfer.CanTransfer) continue;
|
||||||
powerTransfer.CheckJunctions(
|
float maxPowerIn = (thisRelayComponent != null && c.IsOutput) ? 0.0f : clampPower;
|
||||||
deltaTime,
|
float maxPowerOut = (thisRelayComponent != null && !c.IsOutput) ? 0.0f : clampLoad;
|
||||||
false,
|
if (maxPowerIn > 0.0f || maxPowerOut > 0.0f)
|
||||||
(thisRelayComponent != null && c.IsOutput) ? 0.0f : clampPower,
|
{
|
||||||
(thisRelayComponent != null && !c.IsOutput) ? 0.0f : clampLoad);
|
powerTransfer.CheckJunctions(deltaTime, false, maxPowerIn, maxPowerOut);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -55,6 +55,11 @@ namespace Barotrauma.Items.Components
|
|||||||
private set;
|
private set;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return "Connection (" + item.Name + ", " + Name + ")";
|
||||||
|
}
|
||||||
|
|
||||||
public Connection(XElement element, ConnectionPanel connectionPanel)
|
public Connection(XElement element, ConnectionPanel connectionPanel)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user