3DContainerPacking
3DContainerPacking copied to clipboard
Fix wrong condition
The condition of the FindBox inner loop is wrong and allows x go beyond itemsToPack[y].Quantity iterations as soon as Quantity > 1. As a result, the analyzed box may be one of another box "type", and will be analyzed again later by following iterations of outer loop.
The empty item added in Initialize serves no purpose anymore since it just prevented OutOfRange exceptions caused by the wrong check discussed above.