From df0bf301f2a7df2235ceec58b63ce1b6575ee676 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sun, 4 Sep 2016 21:58:44 +1000 Subject: [PATCH] Fix -hax not working if color in the motd. --- Levels/Hacks.cs | 1 + Network/Player.Networking.cs | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Levels/Hacks.cs b/Levels/Hacks.cs index 060abfa1a..314f6a942 100644 --- a/Levels/Hacks.cs +++ b/Levels/Hacks.cs @@ -31,6 +31,7 @@ namespace MCGalaxy { public static byte[] MakeHackControl(Player p) { string motd = p.level.GetMotd(p); + motd = Colors.StripColors(motd); bool isOp = p.Rank >= LevelPermission.Operator; bool fly = true, noclip = true, speed = true, respawn = true, _3rdPerson = true; diff --git a/Network/Player.Networking.cs b/Network/Player.Networking.cs index 2ac6411d7..abb57e9db 100644 --- a/Network/Player.Networking.cs +++ b/Network/Player.Networking.cs @@ -300,8 +300,10 @@ namespace MCGalaxy { if (OnSendMOTD != null) OnSendMOTD(this, packet); Send(packet); - if (HasCpeExt(CpeExt.HackControl)) - Send(Hacks.MakeHackControl(this)); + if (!HasCpeExt(CpeExt.HackControl)) return; + Send(Hacks.MakeHackControl(this)); + if (Game.Referee) + Send(Packet.MakeHackControl(true, true, true, true, true, -1)); } public void SendMap(Level oldLevel) { SendRawMap(oldLevel, level); }