diff Gear.lua @ 83:af2474d28bb4 v39

Added Russian translation.
author yellowfive
date Wed, 03 Aug 2016 18:04:17 -0700
parents 0515882856f1
children fe0bc2f32851
line wrap: on
line diff
--- a/Gear.lua	Tue Jul 19 10:39:42 2016 -0700
+++ b/Gear.lua	Wed Aug 03 18:04:17 2016 -0700
@@ -608,8 +608,20 @@
 			if IsInventoryItemLocked(_pendingEquip.slot) then return end
 		end
 		
-		-- move on to the next item, this item is done
-		_pendingEquip.doneSlots[_pendingEquip.destSlot] = true
+		-- move on to the next item, this item is done or could not be swapped
+		
+		local item = _pendingEquip.itemsToEquip[_pendingEquip.destSlot]
+		local itemLink = GetInventoryItemLink("player", _pendingEquip.destSlot)
+		if itemLink then
+			local invItem = Amr.ParseItemLink(itemLink)
+			if invItem ~= nil then	
+				local diff = countItemDifferences(item, invItem)
+				if diff == 0 then
+					_pendingEquip.doneSlots[_pendingEquip.destSlot] = true
+				end
+			end
+		end
+		
 		_pendingEquip.itemsToEquip[_pendingEquip.destSlot] = nil
 		_pendingEquip.destSlot = nil
 		_pendingEquip.bag = nil