Skip to content

Commit bf1e119

Browse files
committed
Add exemption flag.
Set Grid.Flags |= 1<<31 to exempt a grid from concealment
1 parent acfffc7 commit bf1e119

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎Concealment/ConcealmentPlugin.cs‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ public sealed class ConcealmentPlugin : TorchPluginBase, IWpfPlugin
3838
public Persistent<Settings> Settings { get; private set; }
3939
public MtObservableList<ConcealGroup> ConcealedGroups { get; } = new MtObservableList<ConcealGroup>();
4040

41+
public const EntityFlags EXEMPT_FLAG = (EntityFlags)(1 << 31); //top of MyEntityFlags. Hopefully Keen doesn't add another dozen flags
42+
4143
private readonly Dictionary<long, Timer> _keepAliveTimers = new Dictionary<long, Timer>();
4244
private static readonly Logger Log = LogManager.GetLogger("Concealment");
4345
private UserControl _control;
@@ -346,6 +348,12 @@ public bool IsExcluded(ConcealGroup group)
346348
var pirateId = MyPirateAntennas.GetPiratesId();
347349
foreach (var grid in group.Grids)
348350
{
351+
if ((grid.Flags & EXEMPT_FLAG) == EXEMPT_FLAG)
352+
{
353+
Log.Debug($"{group.GridNames} is kept alive by mod flag");
354+
return true;
355+
}
356+
349357
if (_keepAliveTimers.ContainsKey(grid.EntityId))
350358
{
351359
Log.Debug($"{group.GridNames} is kept alive by PB action");

0 commit comments

Comments
 (0)