Only look for relevant blocks on the same real grid.
This commit is contained in:
@ -20,7 +20,7 @@ namespace IngameScript
|
||||
|
||||
// initialize all the sequencers
|
||||
List<IMyTerminalBlock> blocks = new List<IMyTerminalBlock>();
|
||||
GridTerminalSystem.GetBlocksOfType(blocks, block => MyIni.HasSection(block.CustomData, "sequencer"));
|
||||
GridTerminalSystem.GetBlocksOfType(blocks, blockFilter);
|
||||
|
||||
foreach (IMyTerminalBlock block in blocks)
|
||||
{
|
||||
@ -173,5 +173,10 @@ namespace IngameScript
|
||||
Console.Print($"Can't add unsupported block '{block.CustomName}'");
|
||||
return null;
|
||||
}
|
||||
|
||||
public bool blockFilter(IMyTerminalBlock block)
|
||||
{
|
||||
return block.IsSameConstructAs(this.Me) && MyIni.HasSection(block.CustomData, "sequencer");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user