(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
|
||||
{
|
||||
if (!powerTransfer.CanTransfer) continue;
|
||||
powerTransfer.CheckJunctions(
|
||||
deltaTime,
|
||||
false,
|
||||
(thisRelayComponent != null && c.IsOutput) ? 0.0f : clampPower,
|
||||
(thisRelayComponent != null && !c.IsOutput) ? 0.0f : clampLoad);
|
||||
float maxPowerIn = (thisRelayComponent != null && c.IsOutput) ? 0.0f : clampPower;
|
||||
float maxPowerOut = (thisRelayComponent != null && !c.IsOutput) ? 0.0f : clampLoad;
|
||||
if (maxPowerIn > 0.0f || maxPowerOut > 0.0f)
|
||||
{
|
||||
powerTransfer.CheckJunctions(deltaTime, false, maxPowerIn, maxPowerOut);
|
||||
}
|
||||
}
|
||||
|
||||
continue;
|
||||
|
||||
@@ -55,6 +55,11 @@ namespace Barotrauma.Items.Components
|
||||
private set;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return "Connection (" + item.Name + ", " + Name + ")";
|
||||
}
|
||||
|
||||
public Connection(XElement element, ConnectionPanel connectionPanel)
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user