Unstable 0.17.0.0
This commit is contained in:
+11
-3
@@ -10,7 +10,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
public Sonar ConnectedSonar;
|
||||
|
||||
public SonarTransducer(Item item, XElement element) : base(item, element)
|
||||
public SonarTransducer(Item item, ContentXElement element) : base(item, element)
|
||||
{
|
||||
IsActive = true;
|
||||
}
|
||||
@@ -19,8 +19,6 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
UpdateOnActiveEffects(deltaTime);
|
||||
|
||||
CurrPowerConsumption = powerConsumption * (ConnectedSonar?.CurrentMode == Sonar.Mode.Active ? 1.0f : Sonar.PassivePowerConsumption);
|
||||
|
||||
if (Voltage >= MinVoltage)
|
||||
{
|
||||
sendSignalTimer += deltaTime;
|
||||
@@ -31,5 +29,15 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override float GetCurrentPowerConsumption(Connection connection = null)
|
||||
{
|
||||
if (connection != powerIn || !IsActive)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return PowerConsumption * (ConnectedSonar?.CurrentMode == Sonar.Mode.Active ? 1.0f : Sonar.PassivePowerConsumption);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user