Only look for relevant blocks on the same real grid.

This commit is contained in:
2025-02-19 22:02:43 -05:00
parent a6ff06ac08
commit 79f467e60c
4 changed files with 22 additions and 35 deletions

View File

@ -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");
}
}
}