Fixed nullref exception in CharacterInvetory.UseItemOnSelf if the OnUse statuseffect removes the item. Closes #513
This commit is contained in:
@@ -50,6 +50,10 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
|
|
||||||
Items[slotIndex].ApplyStatusEffects(ActionType.OnUse, 1.0f, character);
|
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)
|
foreach (ItemComponent ic in Items[slotIndex].components)
|
||||||
{
|
{
|
||||||
if (ic.DeleteOnUse)
|
if (ic.DeleteOnUse)
|
||||||
|
|||||||
Reference in New Issue
Block a user