Unstable 1.1.14.0
This commit is contained in:
@@ -26,6 +26,8 @@ namespace Barotrauma
|
||||
|
||||
public static readonly List<InvSlotType> AnySlot = new List<InvSlotType>() { InvSlotType.Any };
|
||||
|
||||
public static bool IsHandSlotType(InvSlotType s) => s.HasFlag(InvSlotType.LeftHand) || s.HasFlag(InvSlotType.RightHand);
|
||||
|
||||
protected bool[] IsEquipped;
|
||||
|
||||
/// <summary>
|
||||
@@ -92,7 +94,7 @@ namespace Barotrauma
|
||||
DebugConsole.ThrowError($"Character \"{character.SpeciesName}\" is configured to spawn with more items than it has inventory capacity for.");
|
||||
}
|
||||
#if DEBUG
|
||||
else if (itemCount > capacity - 2)
|
||||
else if (itemCount > capacity - 2 && !character.IsPet && capacity > 0)
|
||||
{
|
||||
DebugConsole.ThrowError(
|
||||
$"Character \"{character.SpeciesName}\" is configured to spawn with so many items it will have less than 2 free inventory slots. " +
|
||||
@@ -132,6 +134,13 @@ namespace Barotrauma
|
||||
DebugConsole.ThrowError(errorMsg);
|
||||
GameAnalyticsManager.AddErrorEventOnce("CharacterInventory:FailedToSpawnInitialItem", GameAnalyticsManager.ErrorSeverity.Error, errorMsg);
|
||||
}
|
||||
else if (!character.Enabled)
|
||||
{
|
||||
foreach (var heldItem in character.HeldItems)
|
||||
{
|
||||
if (item.body != null) { item.body.Enabled = false; }
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -207,6 +216,10 @@ namespace Barotrauma
|
||||
base.RemoveItem(item);
|
||||
#if CLIENT
|
||||
CreateSlots();
|
||||
if (character == Character.Controlled)
|
||||
{
|
||||
character.SelectedItem?.GetComponent<CircuitBox>()?.OnViewUpdateProjSpecific();
|
||||
}
|
||||
#endif
|
||||
CharacterHUD.RecreateHudTextsIfControlling(character);
|
||||
//if the item was equipped and there are more items in the same stack, equip one of those items
|
||||
@@ -509,14 +522,20 @@ namespace Barotrauma
|
||||
if (character == Character.Controlled)
|
||||
{
|
||||
HintManager.OnObtainedItem(character, item);
|
||||
character.SelectedItem?.GetComponent<CircuitBox>()?.OnViewUpdateProjSpecific();
|
||||
}
|
||||
#endif
|
||||
CharacterHUD.RecreateHudTextsIfControlling(character);
|
||||
if (item.CampaignInteractionType == CampaignMode.InteractionType.Cargo)
|
||||
{
|
||||
item.CampaignInteractionType = CampaignMode.InteractionType.None;
|
||||
item.AssignCampaignInteractionType(CampaignMode.InteractionType.None);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void CreateNetworkEvent(Range slotRange)
|
||||
{
|
||||
GameMain.NetworkMember?.CreateEntityEvent(character, new Character.InventoryStateEventData(slotRange));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user