From 098b0e67a77a86f37fc9b00f5b32184a389a897a Mon Sep 17 00:00:00 2001 From: hondacrx Date: Mon, 8 Jan 2018 22:49:31 -0500 Subject: [PATCH] Core/Items: Try to automatically equip new bags --- Source/Game/Entities/Player/Player.Items.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/Game/Entities/Player/Player.Items.cs b/Source/Game/Entities/Player/Player.Items.cs index 93089d281..823fd2f92 100644 --- a/Source/Game/Entities/Player/Player.Items.cs +++ b/Source/Game/Entities/Player/Player.Items.cs @@ -867,7 +867,13 @@ namespace Game.Entities } // search free slot - res = CanStoreItem_InInventorySlots(InventorySlots.ItemStart, InventorySlots.ItemEnd, dest, pProto, ref count, false, pItem, bag, slot); + byte searchSlotStart = InventorySlots.ItemStart; + // new bags can be directly equipped + if (!pItem && pProto.GetClass() == ItemClass.Container && (ItemSubClassContainer)pProto.GetSubClass() == ItemSubClassContainer.Container && + (pProto.GetBonding() == ItemBondingType.None || pProto.GetBonding() == ItemBondingType.OnAcquire)) + searchSlotStart = InventorySlots.BagStart; + + res = CanStoreItem_InInventorySlots(searchSlotStart, InventorySlots.ItemEnd, dest, pProto, ref count, false, pItem, bag, slot); if (res != InventoryResult.Ok) { no_space_count = count + no_similar_count;