(6e187d247) Fixed contained items' status effects being added twice to the list of an ItemContainer's active status effects when swapping items. For example, when swapping a fuel rod with another one, the status effect that increases AvailableFuel would be applied twice, causing the reactor to act as if there were 2 rods in it. Closes #1643 + merge fix
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user