v1.2.6.0 (Winter Update)

This commit is contained in:
Regalis11
2023-12-14 16:11:27 +02:00
parent af8cc89fce
commit b91e85559d
375 changed files with 7771 additions and 2874 deletions
@@ -39,6 +39,23 @@ namespace Barotrauma
}
public Item? FindItemInContainer(ItemContainer? container)
=> container?.Inventory.GetItemsAt(Slot).ElementAt(StackIndex);
{
var items = container?.Inventory.GetItemsAt(Slot);
if (items != null && StackIndex >= 0 && StackIndex < items.Count())
{
return items.ElementAt(StackIndex);
}
else
{
string errorMsg =
$"Circuit box error: failed to find an item in the container {container?.Item.Name ?? "null"}.";
DebugConsole.ThrowError(
errorMsg +
$" Items: {items?.Count().ToString() ?? "null"}, " +
$" Slot: {Slot}, StackIndex: {StackIndex}");
GameAnalyticsManager.AddErrorEventOnce("ItemSlotIndexPair.FindItemInContainer", GameAnalyticsManager.ErrorSeverity.Error, errorMsg);
return null;
}
}
}
}