Merge remote-tracking branch 'upstream/dev' into develop

This commit is contained in:
EvilFactory
2022-12-09 17:33:44 -03:00
416 changed files with 12674 additions and 5862 deletions
@@ -226,6 +226,14 @@ namespace Barotrauma
{
foreach (var item in slots[i].Items)
{
if (item == null)
{
#if DEBUG
DebugConsole.ThrowError($"Null item in inventory {Owner.ToString() ?? "null"}, slot {i}!");
#endif
continue;
}
bool duplicateFound = false;
for (int j = 0; j < i; j++)
{
@@ -573,11 +581,13 @@ namespace Barotrauma
if (selectedSlot?.Inventory == this) { selectedSlot.ForceTooltipRefresh = true; }
}
#endif
CharacterHUD.RecreateHudTextsIfControlling(user);
if (item.body != null)
{
item.body.Enabled = false;
item.body.BodyType = FarseerPhysics.BodyType.Dynamic;
item.SetTransform(item.SimPosition, rotation: 0.0f, findNewHull: false);
}
#if SERVER
@@ -926,6 +936,7 @@ namespace Barotrauma
if (selectedSlot?.Inventory == this) { selectedSlot.ForceTooltipRefresh = true; }
}
#endif
CharacterHUD.RecreateHudTextsIfFocused(item);
}
}
@@ -952,6 +963,12 @@ namespace Barotrauma
slots[index].RemoveItem(item);
}
public bool IsInSlot(Item item, int index)
{
if (index < 0 || index >= slots.Length) { return false; }
return slots[index].Contains(item);
}
public void SharedRead(IReadMessage msg, out List<ushort>[] newItemIds)
{
byte slotCount = msg.ReadByte();