From 77413208adc55a8f6751775e6d91c4540efc2735 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Tue, 28 Jun 2016 09:09:57 +1000 Subject: [PATCH] Fix /sphere and /torus from yesterday's commits. (Thanks Mirzuuuh) --- Commands/building/CmdSphere.cs | 5 +++-- Commands/building/CmdTorus.cs | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Commands/building/CmdSphere.cs b/Commands/building/CmdSphere.cs index 3692095d1..54ff5c867 100644 --- a/Commands/building/CmdSphere.cs +++ b/Commands/building/CmdSphere.cs @@ -56,8 +56,9 @@ namespace MCGalaxy.Commands.Building { int dx = m[0].X - m[1].X, dy = m[0].Y - m[1].Y, dz = m[0].Z - m[1].Z; int R = (int)Math.Sqrt(dx * dx + dy * dy + dz * dz); - Vec3S32[] marks = { new Vec3S32(m[0].X - R, m[0].Y - R, m[0].Z - R), - new Vec3S32(m[0].X + R, m[0].Y + R, m[0].Z + R) }; + Vec3S32 p0 = m[0]; + m = new [] { new Vec3S32(p0.X - R, p0.Y - R, p0.Z - R), + new Vec3S32(p0.X + R, p0.Y + R, p0.Z + R) }; return DrawOp.DoDrawOp(op, brush, p, m); } diff --git a/Commands/building/CmdTorus.cs b/Commands/building/CmdTorus.cs index 20f6ed977..62d19d98c 100644 --- a/Commands/building/CmdTorus.cs +++ b/Commands/building/CmdTorus.cs @@ -39,8 +39,9 @@ namespace MCGalaxy.Commands.Building { int dx = m[0].X - m[1].X, dy = m[0].Y - m[1].Y, dz = m[0].Z - m[1].Z; int horR = (int)Math.Sqrt(dx * dx + dz * dz), verR = Math.Abs(dy); - Vec3S32[] marks = { new Vec3S32(m[0].X - horR, m[0].Y - verR, m[0].Z - horR), - new Vec3S32(m[0].X + horR, m[0].Y + verR, m[0].Z + horR) }; + Vec3S32 p0 = m[0]; + m = new [] { new Vec3S32(p0.X - horR, p0.Y - verR, p0.Z - horR), + new Vec3S32(p0.X + horR, p0.Y + verR, p0.Z + horR) }; return DrawOp.DoDrawOp(drawOp, brush, p, m); }