Skip to content

Commit

Permalink
Fixing secondary collision index when inserting/deleting block in Son…
Browse files Browse the repository at this point in the history
…ic 128.
  • Loading branch information
MainMemory committed Apr 16, 2016
1 parent 4ae748c commit 83e987a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions SonLVL/MainForm.cs
Expand Up @@ -4198,9 +4198,8 @@ private void DeleteBlock()
LevelData.CompBlockBmps.RemoveAt(SelectedBlock);
LevelData.CompBlockBmpBits.RemoveAt(SelectedBlock);
LevelData.ColInds1.RemoveAt(SelectedBlock);
if (LevelData.Game.EngineVersion == EngineVersion.S2 || LevelData.Game.EngineVersion == EngineVersion.S2NA || LevelData.Game.EngineVersion == EngineVersion.S3K || LevelData.Game.EngineVersion == EngineVersion.SKC)
if (!Object.ReferenceEquals(LevelData.ColInds1, LevelData.ColInds2))
LevelData.ColInds2.RemoveAt(SelectedBlock);
if (LevelData.ColInds2 != null && LevelData.ColInds2 != LevelData.ColInds1)
LevelData.ColInds2.RemoveAt(SelectedBlock);
for (int i = 0; i < LevelData.Chunks.Count; i++)
{
bool dr = false;
Expand Down Expand Up @@ -4283,9 +4282,8 @@ private void InsertBlock()
LevelData.CompBlockBmps.Insert(SelectedBlock, null);
LevelData.CompBlockBmpBits.Insert(SelectedBlock, null);
LevelData.ColInds1.Insert(SelectedBlock, 0);
if (LevelData.Game.EngineVersion == EngineVersion.S2 || LevelData.Game.EngineVersion == EngineVersion.S2NA || LevelData.Game.EngineVersion == EngineVersion.S3K || LevelData.Game.EngineVersion == EngineVersion.SKC)
if (!Object.ReferenceEquals(LevelData.ColInds1, LevelData.ColInds2))
LevelData.ColInds2.Insert(SelectedBlock, 0);
if (LevelData.ColInds2 != null && LevelData.ColInds2 != LevelData.ColInds1)
LevelData.ColInds2.Insert(SelectedBlock, 0);
for (int i = 0; i < LevelData.Chunks.Count; i++)
for (int y = 0; y < LevelData.Level.ChunkHeight / 16; y++)
for (int x = 0; x < LevelData.Level.ChunkWidth / 16; x++)
Expand Down

0 comments on commit 83e987a

Please sign in to comment.