Fixed nullref exception in CharacterInvetory.UseItemOnSelf if the OnUse statuseffect removes the item. Closes #513

This commit is contained in:
Joonas Rikkonen
2018-07-22 17:58:52 +03:00
parent 0728784b8b
commit 78a5dcbfe9

View File

@@ -50,6 +50,10 @@ namespace Barotrauma
}
Items[slotIndex].ApplyStatusEffects(ActionType.OnUse, 1.0f, character);
//item may have been removed by a status effect
if (Items[slotIndex] == null) return true;
foreach (ItemComponent ic in Items[slotIndex].components)
{
if (ic.DeleteOnUse)