diff --git a/Outfitter.lua b/Outfitter.lua index c4daf17..4bca285 100644 --- a/Outfitter.lua +++ b/Outfitter.lua @@ -4412,6 +4412,7 @@ function Outfitter:SetSlotEnable(pSlotName, pEnable) Outfitter:DebugMessage("Enabling slot "..pSlotName) self.SelectedOutfit:SetInventoryItem(pSlotName) else + Outfitter:DebugMessage("Disabling slot "..pSlotName) self.SelectedOutfit:RemoveItem(pSlotName) end diff --git a/Outfitter.toc b/Outfitter.toc index eb5ba82..f564db2 100644 --- a/Outfitter.toc +++ b/Outfitter.toc @@ -3,7 +3,7 @@ ## X-Original-Author: John Stephen ## X-Credits: Mundocani, Miv, Gogo, LemonDrake ## Title: Outfitter -## Version: 5.5.3.3 +## Version: 5.5.3.4 ## Notes: Clothing and weapon management and automated equipment changes ## OptionalDeps: ## RequiredDeps: diff --git a/OutfitterOutfits.lua b/OutfitterOutfits.lua index 365beb7..122c526 100644 --- a/OutfitterOutfits.lua +++ b/OutfitterOutfits.lua @@ -669,17 +669,49 @@ function Outfitter._OutfitMethodsEM:GetItem(pSlotName) end end -function Outfitter._OutfitMethodsEM:UnpackLocation(pLocation) - if not _G["EquipmentManager_UnpackLocation"] then - return nil, nil, nil, nil, nil +--[[ Blizzard removed a function. I'm including it here ]] +local function _EquipmentManager_UnpackLocation (location) -- Use me, I'm here to be used. + -- Default to the original version + if _G["EquipmentManager_UnpackLocation"] then + return EquipmentManager_UnpackLocation(location) + end + + --[[ Continue with the copied version]]-- + if ( location < 0 ) then -- Thanks Seerah! + return false, false, false, 0; + end + + local player = (bit.band(location, ITEM_INVENTORY_LOCATION_PLAYER) ~= 0); + local bank = (bit.band(location, ITEM_INVENTORY_LOCATION_BANK) ~= 0); + local bags = (bit.band(location, ITEM_INVENTORY_LOCATION_BAGS) ~= 0); + + if ( player ) then + location = location - ITEM_INVENTORY_LOCATION_PLAYER; + elseif ( bank ) then + location = location - ITEM_INVENTORY_LOCATION_BANK; + end + + if ( bags ) then + location = location - ITEM_INVENTORY_LOCATION_BAGS; + local bag = bit.rshift(location, ITEM_INVENTORY_BAG_BIT_OFFSET); + local slot = location - bit.lshift(bag, ITEM_INVENTORY_BAG_BIT_OFFSET); + + if ( bank ) then + bag = bag + ITEM_INVENTORY_BANK_BAG_OFFSET; + end + return player, bank, bags, slot, bag + else + return player, bank, bags, location end +end +function Outfitter._OutfitMethodsEM:UnpackLocation(pLocation) local vOnPlayer, vInBank, vInBags, vVoidStorage, vSlotIndex, vBagIndex - if Outfitter.IsMainline then - vOnPlayer, vInBank, vInBags, vVoidStorage, vSlotIndex, vBagIndex = EquipmentManager_UnpackLocation(pLocation) - else - vOnPlayer, vInBank, vInBags, vSlotIndex, vBagIndex = EquipmentManager_UnpackLocation(pLocation) - end + --if Outfitter.IsMainline then + -- vOnPlayer, vInBank, vInBags, vVoidStorage, vSlotIndex, vBagIndex = _EquipmentManager_UnpackLocation(pLocation) + --else + vOnPlayer, vInBank, vInBags, vSlotIndex, vBagIndex = _EquipmentManager_UnpackLocation(pLocation) + --end if vInBags and Outfitter:IsBankBagIndex(vBagIndex) then @@ -838,7 +870,6 @@ function Outfitter._OutfitMethodsEM:SlotIsEquipped(pSlotName, pInventoryCache) end local vOnPlayer, vInBank, vInBags = self:UnpackLocation(vLocation) - return vOnPlayer and not vInBank and not vInBags end --[[ diff --git a/Outfitter_Mainline.toc b/Outfitter_Mainline.toc index bee5a90..93c513b 100644 --- a/Outfitter_Mainline.toc +++ b/Outfitter_Mainline.toc @@ -3,7 +3,7 @@ ## X-Original-Author: John Stephen ## X-Credits: Mundocani, Miv, Gogo, LemonDrake ## Title: Outfitter -## Version: 5.5.3.3 +## Version: 5.5.3.4 ## Notes: Clothing and weapon management and automated equipment changes ## AddonCompartmentFunc: Outfitter_OnAddonCompartmentClick #### AddonCompartmentFuncOnEnter: