d9e5368...df7366c
commit df7366c3d0db4c5cee4d0db33a0eb2ab5c7e28e9 Author: Joonas Rikkonen <poe.regalis@gmail.com> Date: Tue Mar 19 13:22:17 2019 +0200 Save all of the inventory slot indices an item is in, instead of just the first one. Otherwise inventories can get messed up because of equipped items: for example, a revolver may be equipped in a hand slot and the 3rd Any-slot, but just putting it in the and slot during loading will cause it to be placed into the hand slot and the first free Any-slot, potentially preventing whatever was actually in the first Any-slot to be placed in the inventory. Closes #1301 commit 4eeeb3531fe88aeb0dddca2b407ec6f260ea1e8e Author: Joonas Rikkonen <poe.regalis@gmail.com> Date: Tue Mar 19 12:55:27 2019 +0200 Fixed sub/mode voting not being enabled when changing the setting after the server has been started. commit 7f2118b950748d30cc21869cfff9d69fd5c77b81 Author: itchyOwl <lauri.harkanen@gmail.com> Date: Tue Mar 19 12:41:09 2019 +0200 Doors and hatches can now be repaired also with wrenches. Changing the required equipment for anything but door components doesn't have any effect anymore. TODO: remove/disable editing the field when it cannot be edited.
This commit is contained in:
@@ -2530,7 +2530,14 @@ namespace Barotrauma
|
||||
{
|
||||
item.Submarine = inventory.Owner.Submarine;
|
||||
var itemElement = item.Save(parentElement);
|
||||
itemElement.Add(new XAttribute("i", Array.IndexOf(inventory.Items, item)));
|
||||
|
||||
List<int> slotIndices = new List<int>();
|
||||
for (int i = 0; i < inventory.Capacity; i++)
|
||||
{
|
||||
if (inventory.Items[i] == item) { slotIndices.Add(i); }
|
||||
}
|
||||
|
||||
itemElement.Add(new XAttribute("i", string.Join(",", slotIndices)));
|
||||
|
||||
foreach (ItemContainer container in item.GetComponents<ItemContainer>())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user