Permalink
Browse files

Core/Items: Try to automatically equip new bags

Closes #17544
  • Loading branch information...
Shauren committed Jan 7, 2018
1 parent f0666ad commit a16d3209fd1cbc39b9b9fd5219b85419ed9d775c
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/server/game/Entities/Player/Player.cpp
@@ -10732,7 +10732,13 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des
}
// search free slot
res = CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END, dest, pProto, count, false, pItem, bag, slot);
uint8 searchSlotStart = INVENTORY_SLOT_ITEM_START;
// new bags can be directly equipped
if (!pItem && pProto->GetClass() == ITEM_CLASS_CONTAINER && pProto->GetSubClass() == ITEM_SUBCLASS_CONTAINER &&
(pProto->GetBonding() == BIND_NONE || pProto->GetBonding() == BIND_ON_ACQUIRE))
searchSlotStart = INVENTORY_SLOT_BAG_START;
res = CanStoreItem_InInventorySlots(searchSlotStart, INVENTORY_SLOT_ITEM_END, dest, pProto, count, false, pItem, bag, slot);
if (res != EQUIP_ERR_OK)
{
if (no_space_count)

1 comment on commit a16d320

@Ovahlord

This comment has been minimized.

Show comment
Hide comment
@Ovahlord

Ovahlord Jan 8, 2018

Contributor

thanks for taking over on this one. I was really getting lost in this weird named slot madness.

Contributor

Ovahlord commented on a16d320 Jan 8, 2018

thanks for taking over on this one. I was really getting lost in this weird named slot madness.

Please sign in to comment.