diff --git a/src/CromulentBisgetti.ContainerPacking/Algorithms/EB_AFIT.cs b/src/CromulentBisgetti.ContainerPacking/Algorithms/EB_AFIT.cs index c10292c..38e7140 100644 --- a/src/CromulentBisgetti.ContainerPacking/Algorithms/EB_AFIT.cs +++ b/src/CromulentBisgetti.ContainerPacking/Algorithms/EB_AFIT.cs @@ -403,7 +403,7 @@ private void FindBox(decimal hmx, decimal hy, decimal hmy, decimal hz, decimal h for (y = 1; y <= itemsToPackCount; y = y + itemsToPack[y].Quantity) { - for (x = y; x < x + itemsToPack[y].Quantity - 1; x++) + for (x = y; x < y + itemsToPack[y].Quantity - 1; x++) { if (!itemsToPack[x].IsPacked) break; } @@ -549,8 +549,6 @@ private void Initialize(Container container, List items) itemsToPackCount += item.Quantity; } - itemsToPack.Add(new Item(0, 0, 0, 0, 0)); - totalContainerVolume = container.Length * container.Height * container.Width; totalItemVolume = 0.0M; @@ -1219,4 +1217,4 @@ private class ScrapPad #endregion Private Classes } -} \ No newline at end of file +}