fBaseXtensions.XML.MoveItemTag.UpdateStashSlots C# (CSharp) Method

UpdateStashSlots() private method

private UpdateStashSlots ( ) : void
return void
        private void UpdateStashSlots()
        {
            Logger.DBLog.DebugFormat("Updating Stash Slots!");

            // Array for what blocks are or are not blocked
            for (int iRow = 0; iRow <= 49; iRow++)
                for (int iColumn = 0; iColumn <= 6; iColumn++)
                    StashSlotBlocked[iColumn, iRow] = false;
            // Block off the entire of any "protected stash pages"
            foreach (int iProtPage in CharacterSettings.Instance.ProtectedStashPages)
                for (int iProtRow = 0; iProtRow <= 9; iProtRow++)
                    for (int iProtColumn = 0; iProtColumn <= 6; iProtColumn++)
                        StashSlotBlocked[iProtColumn, iProtRow + (iProtPage * 10)] = true;
            // Remove rows we don't have
            for (int iRow = (ZetaDia.Me.NumSharedStashSlots / 7); iRow <= 49; iRow++)
                for (int iColumn = 0; iColumn <= 6; iColumn++)
                    StashSlotBlocked[iColumn, iRow] = true;

            // Map out all the items already in the stash
            foreach (ACDItem tempitem in ZetaDia.Me.Inventory.StashItems)
            {
                if (tempitem.BaseAddress != IntPtr.Zero)
                {
                    //StashedItems.Add(new CacheACDItem(tempitem));
                    int inventoryRow = tempitem.InventoryRow;
                    int inventoryColumn = tempitem.InventoryColumn;
                    // Mark this slot as not-free
                    StashSlotBlocked[inventoryColumn, inventoryRow] = true;
                    // Try and reliably find out if this is a two slot item or not
                    PluginItemTypes tempItemType = ItemFunc.DetermineItemType(tempitem.InternalName, tempitem.ItemType, tempitem.FollowerSpecialType, tempitem.ActorSNO);

                    if (ItemFunc.DetermineIsTwoSlot(tempItemType) && inventoryRow != 19 && inventoryRow != 9 && inventoryRow != 29 && inventoryRow != 39 && inventoryRow != 49)
                    {
                        StashSlotBlocked[inventoryColumn, inventoryRow + 1] = true;
                    }
                    else if (ItemFunc.DetermineIsTwoSlot(tempItemType) && (inventoryRow == 19 || inventoryRow == 9 || inventoryRow == 29 || inventoryRow == 39 || inventoryRow == 49))
                    {
                        Logger.DBLog.DebugFormat("GSError: DemonBuddy thinks this item is 2 slot even though it's at bottom row of a stash page: " + tempitem.Name + " [" + tempitem.InternalName +
                              "] type=" + tempItemType.ToString() + " @ slot " + (inventoryRow + 1).ToString(CultureInfo.InvariantCulture) + "/" +
                              (inventoryColumn + 1).ToString(CultureInfo.InvariantCulture));
                    }
                }
            } // Loop through all stash items

            bUpdatedStashMap = true;
        }