static void DoorAdd(Player player, Vector3I[] marks, object tag)
{
int sx = Math.Min(marks[0].X, marks[1].X);
int ex = Math.Max(marks[0].X, marks[1].X);
int sy = Math.Min(marks[0].Y, marks[1].Y);
int ey = Math.Max(marks[0].Y, marks[1].Y);
int sh = Math.Min(marks[0].Z, marks[1].Z);
int eh = Math.Max(marks[0].Z, marks[1].Z);
int volume = (ex - sx + 1) * (ey - sy + 1) * (eh - sh + 1);
if (volume > maxDoorBlocks)
{
player.Message("Doors are only allowed to be {0} blocks", maxDoorBlocks);
return;
}
Zone door = (Zone)tag;
door.Create(new BoundingBox(marks[0], marks[1]), player.Info);
player.WorldMap.Zones.Add(door);
Logger.Log(LogType.UserActivity, "{0} created door {1} (on world {2})", player.Name, door.Name, player.World.Name);
player.Message("Door created: {0}x{1}x{2}", door.Bounds.Dimensions.X,
door.Bounds.Dimensions.Y,
door.Bounds.Dimensions.Z);
}