Fix fireworks not working on min borders of map

This commit is contained in:
UnknownShadow200 2018-02-05 14:46:32 +11:00
parent 5ea3db341a
commit dd57ed8f67
3 changed files with 7 additions and 4 deletions

View File

@ -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;

View File

@ -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"; } }

View File

@ -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 {