Index: binary-improvements/MapRendering/Web/API/GetPlayerInventory.cs
===================================================================
--- binary-improvements/MapRendering/Web/API/GetPlayerInventory.cs	(revision 251)
+++ binary-improvements/MapRendering/Web/API/GetPlayerInventory.cs	(revision 253)
@@ -8,4 +8,5 @@
 {
 	public class GetPlayerInventory : WebAPI {
+
 		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user, int permissionLevel) {
 			if (req.QueryString ["steamid"] == null) {
@@ -38,18 +39,17 @@
 			DoInventory (bag, inv.bag);
 
-			AddEquipment (equipment, "head", inv.equipment, XMLData.Item.EnumEquipmentSlot.Head, NGuiInvGridEquipment.EnumClothingLayer.Middle);
-			AddEquipment (equipment, "eyes", inv.equipment, XMLData.Item.EnumEquipmentSlot.Eyes, NGuiInvGridEquipment.EnumClothingLayer.Middle);
-			AddEquipment (equipment, "face", inv.equipment, XMLData.Item.EnumEquipmentSlot.Face, NGuiInvGridEquipment.EnumClothingLayer.Middle);
+			AddEquipment (equipment, "head", inv.equipment, EquipmentSlots.Headgear);
+			AddEquipment (equipment, "eyes", inv.equipment, EquipmentSlots.Eyewear);
+			AddEquipment (equipment, "face", inv.equipment, EquipmentSlots.Face);
 
-			AddEquipment (equipment, "armor", inv.equipment, XMLData.Item.EnumEquipmentSlot.Chest, NGuiInvGridEquipment.EnumClothingLayer.Outer);
-			AddEquipment (equipment, "jacket", inv.equipment, XMLData.Item.EnumEquipmentSlot.Chest, NGuiInvGridEquipment.EnumClothingLayer.Middle);
-			AddEquipment (equipment, "shirt", inv.equipment, XMLData.Item.EnumEquipmentSlot.Chest, NGuiInvGridEquipment.EnumClothingLayer.Inner);
+			AddEquipment (equipment, "armor", inv.equipment, EquipmentSlots.ChestArmor);
+			AddEquipment (equipment, "jacket", inv.equipment, EquipmentSlots.Jacket);
+			AddEquipment (equipment, "shirt", inv.equipment, EquipmentSlots.Shirt);
 
-			AddEquipment (equipment, "legarmor", inv.equipment, XMLData.Item.EnumEquipmentSlot.Legs, NGuiInvGridEquipment.EnumClothingLayer.Outer);
-			AddEquipment (equipment, "pants", inv.equipment, XMLData.Item.EnumEquipmentSlot.Legs, NGuiInvGridEquipment.EnumClothingLayer.Inner);
-			AddEquipment (equipment, "boots", inv.equipment, XMLData.Item.EnumEquipmentSlot.Feet, NGuiInvGridEquipment.EnumClothingLayer.Inner);
+			AddEquipment (equipment, "legarmor", inv.equipment, EquipmentSlots.LegArmor);
+			AddEquipment (equipment, "pants", inv.equipment, EquipmentSlots.Legs);
+			AddEquipment (equipment, "boots", inv.equipment, EquipmentSlots.Feet);
 
-			AddEquipment (equipment, "gloves", inv.equipment, XMLData.Item.EnumEquipmentSlot.Hands, NGuiInvGridEquipment.EnumClothingLayer.Inner);
-			AddEquipment (equipment, "backpack", inv.equipment, XMLData.Item.EnumEquipmentSlot.Back, NGuiInvGridEquipment.EnumClothingLayer.Outer);
+			AddEquipment (equipment, "gloves", inv.equipment, EquipmentSlots.Hands);
 
 			WriteJSON (resp, result);
@@ -62,11 +62,16 @@
 		}
 
-		private void AddEquipment (JSONObject _eq, string _slotname, InvItem[] _items, XMLData.Item.EnumEquipmentSlot _slot, NGuiInvGridEquipment.EnumClothingLayer _layer) {
-			int index = (int)_slot + (int)_layer * (int)XMLData.Item.EnumEquipmentSlot.Count;
-			if (_items != null) {
-				_eq.Add (_slotname, GetJsonForItem (_items [index]));
-			} else {
-				_eq.Add (_slotname, new JSONNull ());
+		private void AddEquipment (JSONObject _eq, string _slotname, InvItem[] _items, EquipmentSlots _slot) {
+			int[] slotindices = XUiM_PlayerEquipment.GetSlotIndicesByEquipmentSlot (_slot);
+
+			for (int i = 0; i < slotindices.Length; i++) {
+				if (_items != null && _items [slotindices [i]] != null) {
+					InvItem item = _items [slotindices [i]];
+					_eq.Add (_slotname, GetJsonForItem (item));
+					return;
+				}
 			}
+
+			_eq.Add (_slotname, new JSONNull ());
 		}
 
@@ -75,8 +80,8 @@
 				JSONObject jsonItem = new JSONObject ();
 				jsonItem.Add ("count", new JSONNumber (_item.count));
-                jsonItem.Add ("name", new JSONString (_item.itemName));
-                jsonItem.Add ("icon", new JSONString (_item.icon));
-                jsonItem.Add ("iconcolor", new JSONString ((string.IsNullOrEmpty (_item.iconcolor) || _item.iconcolor == "FFFFFF" ? "" : _item.iconcolor)));
-                jsonItem.Add ("quality", new JSONNumber(_item.quality));
+				jsonItem.Add ("name", new JSONString (_item.itemName));
+				jsonItem.Add ("icon", new JSONString (_item.icon));
+				jsonItem.Add ("iconcolor", new JSONString (_item.iconcolor));
+				jsonItem.Add ("quality", new JSONNumber (_item.quality));
 				if (_item.quality >= 0) {
 					jsonItem.Add ("qualitycolor", new JSONString (QualityInfo.GetQualityColorHex (_item.quality)));
