public static void DoAir(Level lvl, ref PhysInfo C) { if (C.Data.Type1 == PhysicsArgs.Custom) { DoorPhysics.Do(lvl, ref C); return; } ushort x = C.X, y = C.Y, z = C.Z; ActivateablePhysics.CheckNeighbours(lvl, x, y, z); ActivateablePhysics.CheckAt(lvl, x, (ushort)(y - 1), z); //Edge of map water if (lvl.Config.EdgeWater && (y < lvl.Config.EdgeLevel && y >= (lvl.Config.EdgeLevel + lvl.Config.SidesOffset))) { if (x == 0 || x == lvl.Width - 1 || z == 0 || z == lvl.Length - 1) { BlockID horizon = lvl.Config.HorizonBlock; lvl.AddUpdate(C.Index, horizon == Block.Invalid ? Block.Water : horizon); } } if (!C.Data.HasWait) { C.Data.Data = PhysicsArgs.RemoveFromChecks; } }
public static void DoAir(Level lvl, ref Check C) { ushort x, y, z; lvl.IntToPos(C.b, out x, out y, out z); ActivateablePhysics.CheckNeighbours(lvl, x, y, z); ActivateablePhysics.CheckAt(lvl, lvl.PosToInt(x, (ushort)(y - 1), z)); //Edge of map water if (lvl.Config.EdgeWater && (y < lvl.Config.EdgeLevel && y >= (lvl.Config.EdgeLevel + lvl.Config.SidesOffset))) { if (x == 0 || x == lvl.Width - 1 || z == 0 || z == lvl.Length - 1) { ExtBlock block = ExtBlock.FromRaw((byte)lvl.Config.HorizonBlock); PhysicsArgs args = default(PhysicsArgs); args.ExtBlock = block.BlockID == Block.custom_block; lvl.AddUpdate(C.b, block.RawID, false, args); } } if (!C.data.HasWait) { C.data.Data = PhysicsArgs.RemoveFromChecks; } }