(208dc8793) Fixed ElectricalDischarger electricity effect staying visible if the item breaks or the component is deactivated from outside (e.g. via a StatusEffect or the parent component). Closes #1402
This commit is contained in:
@@ -34,6 +34,20 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
}
|
||||
|
||||
public override bool IsActive
|
||||
{
|
||||
get { return base.IsActive; }
|
||||
set
|
||||
{
|
||||
base.IsActive = value;
|
||||
if (!value)
|
||||
{
|
||||
nodes.Clear();
|
||||
charactersInRange.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Serialize(100.0f, true), Editable(MinValueFloat = 0.0f, MaxValueFloat = 5000.0f)]
|
||||
public float Range
|
||||
{
|
||||
@@ -126,14 +140,19 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
else
|
||||
{
|
||||
nodes.Clear();
|
||||
charactersInRange.Clear();
|
||||
IsActive = false;
|
||||
}
|
||||
|
||||
voltage = 0.0f;
|
||||
}
|
||||
|
||||
public override void UpdateBroken(float deltaTime, Camera cam)
|
||||
{
|
||||
base.UpdateBroken(deltaTime, cam);
|
||||
nodes.Clear();
|
||||
charactersInRange.Clear();
|
||||
}
|
||||
|
||||
private void Discharge()
|
||||
{
|
||||
ApplyStatusEffects(ActionType.OnUse, 1.0f);
|
||||
|
||||
Reference in New Issue
Block a user