Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
toRemove tweaked
  • Loading branch information
N1Ran committed Nov 23, 2019
commit f46b9367e9aedc3a88e5f2c868d8f90b16a6ee2a
4 changes: 2 additions & 2 deletions Essentials/Commands/BlocksModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public void RemoveSubtype(string subtype, string target = null)
return;
}

var toRemove = (from grid in grids from block in grid.GetFatBlocks().OfType<MySlimBlock>().ToList() let blockSubtype = block.BlockDefinition.Id.SubtypeName where string.Compare(subtype, blockSubtype, StringComparison.OrdinalIgnoreCase) == 0 select block).ToList();
var toRemove = (from grid in grids from block in grid.GetBlocks() let blockSubtype = block.BlockDefinition.Id.SubtypeName where string.Compare(subtype, blockSubtype, StringComparison.OrdinalIgnoreCase) == 0 select block).ToList();

var count = toRemove.Count;

Expand All @@ -212,7 +212,7 @@ public void RemoveType(string type, string target = null)
return;
}

var toRemove = (from grid in grids from block in grid.GetFatBlocks().OfType<MySlimBlock>().ToList() let blockType = block.BlockDefinition.Id.TypeId.ToString().Substring(16) where string.Compare(type, blockType, StringComparison.OrdinalIgnoreCase) == 0 select block).ToList();
var toRemove = (from grid in grids from block in grid.GetBlocks() let blockType = block.BlockDefinition.Id.TypeId.ToString().Substring(16) where string.Compare(type, blockType, StringComparison.OrdinalIgnoreCase) == 0 select block).ToList();

var count = toRemove.Count;
foreach (var x in toRemove)
Expand Down