Should be able to use /fly when +fly in MOTD

This commit is contained in:
UnknownShadow200 2018-03-14 08:23:17 +11:00
parent 88db6ff127
commit 80cf6c2ced
2 changed files with 8 additions and 8 deletions

View File

@ -28,7 +28,7 @@ namespace MCGalaxy.Commands.Misc {
public override bool SuperUseable { get { return false; } }
public override void Use(Player p, string message) {
if (!Hacks.CanUseHacks(p, p.level)) {
if (!Hacks.CanUseFly(p, p.level)) {
Player.Message(p, "You cannot use %T/Fly %Son this map.");
p.isFlying = false; return;
}

View File

@ -22,11 +22,13 @@ namespace MCGalaxy {
public static class Hacks {
public static bool CanUseHacks(Player p, Level lvl) {
string motd = lvl.GetMotd(p);
bool noHacks = motd.CaselessContains("-hax");
if (noHacks && p.Rank >= LevelPermission.Operator && motd.CaselessContains("+ophax"))
return true;
return !noHacks;
byte[] packet = MakeHackControl(p, lvl.GetMotd(p));
return packet[1] != 0 && packet[2] != 0 && packet[3] != 0 && packet[4] != 0 && packet[5] != 0;
}
public static bool CanUseFly(Player p, Level lvl) {
byte[] packet = MakeHackControl(p, lvl.GetMotd(p));
return packet[1] != 0;
}
public static byte[] MakeHackControl(Player p, string motd) {
@ -40,8 +42,6 @@ namespace MCGalaxy {
string part = parts[i];
if (part.CaselessEq("-hax")) {
fly = false; noclip = false; speed = false; respawn = false; _3rdPerson = false;
} if (part.CaselessEq("-hax")) {
fly = false; noclip = false; speed = false; respawn = false; _3rdPerson = false;
} else if (part.CaselessEq("-ophax") && isOp) {
fly = false; noclip = false; speed = false; respawn = false; _3rdPerson = false;
} else if (part.CaselessEq("+ophax") && isOp) {