Fixed Powered ItemComponents (not components deriving from Powered) never resetting their voltage after receiving power, causing them to stay powered indefinitely. Closes #247
This commit is contained in:
@@ -86,7 +86,7 @@ namespace Barotrauma.Items.Components
|
||||
if (connection.IsPower) voltage = power;
|
||||
}
|
||||
|
||||
public override void Update(float deltaTime, Camera cam)
|
||||
protected void UpdateOnActiveEffects(float deltaTime)
|
||||
{
|
||||
if (currPowerConsumption == 0.0f)
|
||||
{
|
||||
@@ -109,7 +109,7 @@ namespace Barotrauma.Items.Components
|
||||
powerOnSoundPlayed = true;
|
||||
}
|
||||
}
|
||||
else if (voltage < 0.1f)
|
||||
else if (voltage < 0.1f)
|
||||
{
|
||||
powerOnSoundPlayed = false;
|
||||
}
|
||||
@@ -121,6 +121,13 @@ namespace Barotrauma.Items.Components
|
||||
#endif
|
||||
}
|
||||
|
||||
public override void Update(float deltaTime, Camera cam)
|
||||
{
|
||||
UpdateOnActiveEffects(deltaTime);
|
||||
|
||||
voltage = 0.0f;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user