(23df6915f) Added: Possibility of having a status effect trigger if a requiredItem is missing

This commit is contained in:
Joonas Rikkonen
2019-06-12 16:45:02 +03:00
parent b598459179
commit dce98349ea
16 changed files with 87 additions and 120 deletions
@@ -256,18 +256,6 @@ namespace Barotrauma
{
if (c.Info == null || c.Inventory == null) { continue; }
var inventoryElement = new XElement("inventory");
// Recharge headset batteries
var headset = c.Inventory.FindItemByIdentifier("headset");
if (headset != null)
{
var battery = headset.OwnInventory.FindItemByTag("loadable");
if (battery != null)
{
battery.Condition = battery.MaxCondition;
}
}
c.SaveInventory(c.Inventory, inventoryElement);
c.Info.InventoryData = inventoryElement;
c.Inventory?.DeleteAllItems();