diff --git a/common/inventory_profile.cpp b/common/inventory_profile.cpp index 6d16f50b0..4907cd1b9 100644 --- a/common/inventory_profile.cpp +++ b/common/inventory_profile.cpp @@ -1839,7 +1839,7 @@ int16 EQ::InventoryProfile::FindFirstFreeSlotThatFitsItem(const EQ::ItemData *it } } } - return 0; + return INVALID_INDEX; } //This function has the same flaw as noted above diff --git a/zone/inventory.cpp b/zone/inventory.cpp index 812d09aba..cb28aeb2c 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -4679,7 +4679,8 @@ bool Client::PutItemInInventoryWithStacking(EQ::ItemInstance *inst) return true; } } - if (free_id != INVALID_INDEX) { + // Protect equipment slots (0-22) from being overwritten + if (free_id != INVALID_INDEX && !EQ::ValueWithin(free_id, EQ::invslot::EQUIPMENT_BEGIN, EQ::invslot::EQUIPMENT_END)) { if (PutItemInInventory(free_id, *inst, true)) { return true; }