(869ac975f) Merge branch 'master' into dev

This commit is contained in:
Joonas Rikkonen
2019-06-12 16:43:56 +03:00
parent eaf4f6afb8
commit e3ca616fff
28 changed files with 372 additions and 162 deletions
@@ -256,6 +256,18 @@ 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();