Fix /c4, trying to place detonator not working

This commit is contained in:
UnknownShadow200 2017-09-30 08:21:37 +10:00
parent 383c6334a8
commit 9113bcc344
2 changed files with 5 additions and 5 deletions

View File

@ -63,7 +63,7 @@ namespace MCGalaxy.Blocks {
} }
// Use red wool to detonate c4 // Use red wool to detonate c4
ExtBlock held = p.GetHeldBlock(); ExtBlock held = p.BlockBindings[p.RawHeldBlock.RawID];
if (held.BlockID == Block.Red) { if (held.BlockID == Block.Red) {
Player.Message(p, "Placed detonator block, delete it to detonate."); Player.Message(p, "Placed detonator block, delete it to detonate.");
C4Det(p, (ExtBlock)Block.C4Detonator, x, y, z); return; C4Det(p, (ExtBlock)Block.C4Detonator, x, y, z); return;

View File

@ -145,9 +145,9 @@ namespace MCGalaxy.Commands {
internal static bool GetCoords(Player p, string[] args, int argsOffset, ref Vec3S32 P) { internal static bool GetCoords(Player p, string[] args, int argsOffset, ref Vec3S32 P) {
return return
GetCoord(p, args[argsOffset + 0], P.X, "X", out P.X) && GetCoord(p, args[argsOffset + 0], P.X, "X coordinate", out P.X) &&
GetCoord(p, args[argsOffset + 1], P.Y, "Y", out P.Y) && GetCoord(p, args[argsOffset + 1], P.Y, "Y coordinate", out P.Y) &&
GetCoord(p, args[argsOffset + 2], P.Z, "Z", out P.Z); GetCoord(p, args[argsOffset + 2], P.Z, "Z coordinate", out P.Z);
} }
static bool GetCoord(Player p, string arg, int cur, string axis, out int value) { static bool GetCoord(Player p, string arg, int cur, string axis, out int value) {
@ -155,7 +155,7 @@ namespace MCGalaxy.Commands {
if (relative) arg = arg.Substring(1); if (relative) arg = arg.Substring(1);
value = 0; value = 0;
if (!GetInt(p, arg, axis + " coordinate", ref value)) return false; if (!GetInt(p, arg, axis, ref value)) return false;
if (relative) value += cur; if (relative) value += cur;
return true; return true;
} }