Skip to content

Commit 2c778d7

Browse files
N1Ranrexxar-tc
authored andcommitted
Faction Cleanup (#120)
1 parent eaa76d3 commit 2c778d7

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎Essentials/Commands/CleanupModule.cs‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,13 @@ public bool OwnedBy(MyCubeGrid grid, string str)
311311
return grid.BigOwners.Contains(identityId);
312312
}
313313

314+
[Condition("faction", helpText: "Finds grids owned by the given faction. Specify by faction tag.")]
315+
public bool Faction(MyCubeGrid grid, string factionTag)
316+
{
317+
var target = MySession.Static.Factions.TryGetFactionByTag(factionTag);
318+
return factionTag != null && target.Members.Keys.Select(member => grid.BigOwners.Contains(member)).FirstOrDefault();
319+
}
320+
314321
[Condition("hastype", "notype", "Finds grids containing blocks of the given type.")]
315322
public bool BlockType(MyCubeGrid grid, string str)
316323
{

0 commit comments

Comments
 (0)