mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-24 05:03:34 -04:00
don't use a try catch in CmdExplode
This commit is contained in:
parent
42739945ad
commit
7764c19eb4
@ -32,7 +32,7 @@ namespace MCGalaxy.Commands.Fun {
|
||||
if (!(args.Length == 1 || args.Length == 3)) { Help(p); return; }
|
||||
if (message.CaselessEq("me") && p != null) args[0] = p.name;
|
||||
|
||||
ushort x, y, z;
|
||||
ushort x = 0, y = 0, z = 0;
|
||||
if (args.Length == 1) {
|
||||
Player who = PlayerInfo.FindMatches(p, args[0]);
|
||||
if (who == null) return;
|
||||
@ -43,17 +43,15 @@ namespace MCGalaxy.Commands.Fun {
|
||||
if (DoExplode(p, who.level, x, y, z))
|
||||
Player.Message(p, who.ColoredName + " %Shas been exploded!");
|
||||
} else if (args.Length == 3) {
|
||||
try {
|
||||
x = ushort.Parse(args[0]);
|
||||
y = ushort.Parse(args[1]);
|
||||
z = ushort.Parse(args[2]);
|
||||
} catch {
|
||||
Player.Message(p, "Invalid parameters"); return;
|
||||
}
|
||||
if (!CommandParser.GetUShort(p, args[0], "X", ref x)) return;
|
||||
if (!CommandParser.GetUShort(p, args[1], "Y", ref y)) return;
|
||||
if (!CommandParser.GetUShort(p, args[2], "Z", ref z)) return;
|
||||
|
||||
if (y >= p.level.Height) y = (ushort)(p.level.Height - 1);
|
||||
if (DoExplode(p, p.level, x, y, z))
|
||||
Player.Message(p, "An explosion was made at {0}, {1}, {2}).", x, y, z);
|
||||
} else {
|
||||
Help(p);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,9 +17,8 @@
|
||||
*/
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using MCGalaxy.DB;
|
||||
using MCGalaxy.SQL;
|
||||
using MCGalaxy.Eco;
|
||||
using MCGalaxy.SQL;
|
||||
|
||||
namespace MCGalaxy.Core {
|
||||
internal static class EcoHandlers {
|
||||
|
@ -16,7 +16,6 @@
|
||||
permissions and limitations under the Licenses.
|
||||
*/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
*/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using MCGalaxy.Events.EconomyEvents;
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
*/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
|
||||
namespace MCGalaxy {
|
||||
|
Loading…
x
Reference in New Issue
Block a user