Skip to content

Commit

Permalink
Correcting block importing with collision.
Browse files Browse the repository at this point in the history
  • Loading branch information
MainMemory committed May 26, 2015
1 parent c8dc8a7 commit bf2638f
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions SonLVL/MainForm.cs
Expand Up @@ -4813,8 +4813,8 @@ private void ImportImage(Bitmap bmp, Bitmap colbmp1, Bitmap colbmp2, Bitmap prib
}
if (match) continue;
blocks.Add(blkb);
colInds1.Add(col.ColInd1);
colInds2.Add(col.ColInd2);
colInds1.AddOrSet(blocks.Count - 1, col.ColInd1);
colInds2.AddOrSet(blocks.Count - 1, col.ColInd2);
newBlocks.Add(blk);
newColInds1.Add(col.ColInd1);
newColInds2.Add(col.ColInd2);
Expand Down Expand Up @@ -4991,9 +4991,9 @@ private void ImportImage(Bitmap bmp, Bitmap colbmp1, Bitmap colbmp2, Bitmap prib
Application.DoEvents();
if (blockcoldata != null)
{
if (LevelData.ColInds1[i] != col.ColInd1)
if (colInds1[i] != col.ColInd1)
continue;
if (!Object.ReferenceEquals(LevelData.ColInds1, LevelData.ColInds2) && LevelData.ColInds2[i] != col.ColInd2)
if (!Object.ReferenceEquals(LevelData.ColInds1, LevelData.ColInds2) && colInds2[i] != col.ColInd2)
continue;
}
if (blkb.FastArrayEqual(blocks[i]) || blkh.FastArrayEqual(blocks[i])
Expand All @@ -5005,6 +5005,8 @@ private void ImportImage(Bitmap bmp, Bitmap colbmp1, Bitmap colbmp2, Bitmap prib
}
if (match) continue;
blocks.Add(blkb);
colInds1.AddOrSet(blocks.Count - 1, col.ColInd1);
colInds2.AddOrSet(blocks.Count - 1, col.ColInd2);
newBlocks.Add(blk);
newColInds1.Add(col.ColInd1);
newColInds2.Add(col.ColInd2);
Expand Down Expand Up @@ -8074,8 +8076,8 @@ private void pasteOverToolStripMenuItem_Click(object sender, EventArgs e)
}
if (match) continue;
blocks.Add(blkb);
colInds1.Add(col.ColInd1);
colInds2.Add(col.ColInd2);
colInds1.AddOrSet(blocks.Count - 1, col.ColInd1);
colInds2.AddOrSet(blocks.Count - 1, col.ColInd2);
newBlocks.Add(blk);
newColInds1.Add(col.ColInd1);
newColInds2.Add(col.ColInd2);
Expand Down

0 comments on commit bf2638f

Please sign in to comment.