Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
added cleanup option for center of world
This works quite similar to distance for player but instead of that it uses the origin vector as reference.
  • Loading branch information
LordTylus committed Nov 26, 2020
commit 4e6c05060e16c8682e394fc1042962428809dc14
8 changes: 8 additions & 0 deletions Essentials/Commands/CleanupModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,14 @@ public bool PlayerDistanceLessThan(MyCubeGrid grid, double dist)
return false;
}

[Condition("centerdistancelessthan", "centerdistancegreaterthan", "Finds grids that are further than the given distance from center.")]
public bool CenterDistanceLessThan(MyCubeGrid grid, double dist)
{
dist *= dist;

return Vector3D.DistanceSquared(Vector3D.Zero, grid.PositionComp.GetPosition()) < dist;
}

[Condition("ownedby", helpText: "Finds grids owned by the given player. Can specify player name, IdentityId, 'nobody', or 'pirates'.")]
public bool OwnedBy(MyCubeGrid grid, string str)
{
Expand Down