Fixed crashing if the Use method of a wire is triggered by a StatusEffect

This commit is contained in:
Joonas Rikkonen
2018-07-18 11:24:56 +03:00
parent 23e0a76f37
commit 1ef2cb7500
@@ -222,6 +222,7 @@ namespace Barotrauma.Items.Components
public override bool Use(float deltaTime, Character character = null) public override bool Use(float deltaTime, Character character = null)
{ {
if (character == null) return false;
if (character == Character.Controlled && character.SelectedConstruction != null) return false; if (character == Character.Controlled && character.SelectedConstruction != null) return false;
if (newNodePos != Vector2.Zero && nodes.Count > 0 && Vector2.Distance(newNodePos, nodes[nodes.Count - 1]) > nodeDistance) if (newNodePos != Vector2.Zero && nodes.Count > 0 && Vector2.Distance(newNodePos, nodes[nodes.Count - 1]) > nodeDistance)