Not all terminal blocks have the "ShowOnHUD" value to set, and thus if you do
foreach(IMyTerminalBlock block in blocklist) {
if (damaged) block.SetValue("ShowOnHUD", true);
}
it will invariably throw a null pointer or whatever.
Is there a simple way to use IMyTerminalBlock.GetProperties or whatever to easily tell if a block has that function before I try to apply it?
I tried enclosing the action in a try catch, but the execution would still fail.
foreach(IMyTerminalBlock block in blocklist) {
if (damaged) block.SetValue("ShowOnHUD", true);
}
it will invariably throw a null pointer or whatever.
Is there a simple way to use IMyTerminalBlock.GetProperties or whatever to easily tell if a block has that function before I try to apply it?
I tried enclosing the action in a try catch, but the execution would still fail.