From dd57ed8f677ae601cfb1a4c4d3c82fe5eba417ad Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Mon, 5 Feb 2018 14:46:32 +1100 Subject: [PATCH] Fix fireworks not working on min borders of map --- MCGalaxy/Blocks/Physics/FireworkPhysics.cs | 8 ++++---- MCGalaxy/Commands/Fun/CmdExplode.cs | 2 ++ MCGalaxy/Commands/Fun/CmdGun.cs | 1 + 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/MCGalaxy/Blocks/Physics/FireworkPhysics.cs b/MCGalaxy/Blocks/Physics/FireworkPhysics.cs index edf67fc2d..7c7342c26 100644 --- a/MCGalaxy/Blocks/Physics/FireworkPhysics.cs +++ b/MCGalaxy/Blocks/Physics/FireworkPhysics.cs @@ -63,11 +63,11 @@ namespace MCGalaxy.Blocks.Physics { lvl.AddUpdate(lvl.PosToInt(x, y, z), Block.Air); int index; - for (ushort yy = (ushort)(y - (size + 1)); yy <= (ushort)(y + (size + 1)); ++yy) - for (ushort zz = (ushort)(z - (size + 1)); zz <= (ushort)(z + (size + 1)); ++zz) - for (ushort xx = (ushort)(x - (size + 1)); xx <= (ushort)(x + (size + 1)); ++xx) + for (int yy = y - (size + 1); yy <= y + (size + 1); ++yy) + for (int zz = z - (size + 1); zz <= z + (size + 1); ++zz) + for (int xx = x - (size + 1); xx <= x + (size + 1); ++xx) { - if (lvl.IsAirAt(xx, yy, zz, out index) && rand.Next(1, 40) < 2) { + if (lvl.IsAirAt((ushort)xx, (ushort)yy, (ushort)zz, out index) && rand.Next(1, 40) < 2) { PhysicsArgs args = default(PhysicsArgs); args.Type1 = PhysicsArgs.Drop; args.Value1 = 100; args.Type2 = PhysicsArgs.Dissipate; args.Value2 = 25; diff --git a/MCGalaxy/Commands/Fun/CmdExplode.cs b/MCGalaxy/Commands/Fun/CmdExplode.cs index 52f692c56..b4dbc8012 100644 --- a/MCGalaxy/Commands/Fun/CmdExplode.cs +++ b/MCGalaxy/Commands/Fun/CmdExplode.cs @@ -18,6 +18,8 @@ permissions and limitations under the Licenses. */ using System; +using BlockID = System.UInt16; + namespace MCGalaxy.Commands.Fun { public sealed class CmdExplode : Command { public override string name { get { return "Explode"; } } diff --git a/MCGalaxy/Commands/Fun/CmdGun.cs b/MCGalaxy/Commands/Fun/CmdGun.cs index c2439b5c8..8c1352e7a 100644 --- a/MCGalaxy/Commands/Fun/CmdGun.cs +++ b/MCGalaxy/Commands/Fun/CmdGun.cs @@ -20,6 +20,7 @@ using System.Collections.Generic; using System.Threading; using MCGalaxy.Maths; using MCGalaxy.Tasks; +using BlockID = System.UInt16; namespace MCGalaxy.Commands.Fun { public sealed class CmdGun : WeaponCmd {