(ee53e1507) Fixed crashing when a StatusEffect causes an item to be used on a target. Closes #1466

This commit is contained in:
Joonas Rikkonen
2019-05-16 06:47:23 +03:00
parent 4b7458cc44
commit 58d60c9162
11 changed files with 215 additions and 259 deletions
@@ -1527,13 +1527,16 @@ namespace Barotrauma
if (!picked) return false;
if (picker.SelectedConstruction == this)
if (picker != null)
{
if (picker.IsKeyHit(InputType.Select) || forceSelectKey) picker.SelectedConstruction = null;
}
else if (selected)
{
picker.SelectedConstruction = this;
if (picker.SelectedConstruction == this)
{
if (picker.IsKeyHit(InputType.Select) || forceSelectKey) picker.SelectedConstruction = null;
}
else if (selected)
{
picker.SelectedConstruction = this;
}
}
#if CLIENT