From 07fe07aca2b7bbe6674a7e06e6a3f44825eed74a Mon Sep 17 00:00:00 2001 From: Peteys93 Date: Thu, 21 Apr 2016 22:07:38 -0400 Subject: [PATCH] Impersonate bug fixes See post on #123 Can no longer impersonate muted players Trying to impersonate a player on server without giving a message threw an error, fixed. --- Commands/other/CmdImpersonate.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Commands/other/CmdImpersonate.cs b/Commands/other/CmdImpersonate.cs index 2f8b430b5..62edf64a1 100644 --- a/Commands/other/CmdImpersonate.cs +++ b/Commands/other/CmdImpersonate.cs @@ -27,10 +27,11 @@ namespace MCGalaxy.Commands { static char[] trimChars = { ' ' }; public override void Use(Player p, string message) { - if (message == "") { Help(p); return; } + if (!message.Contains(" ")) { Help(p); return; } string[] args = message.Split(trimChars, 2); Player who = PlayerInfo.FindOrShowMatches(p, args[0]); - if (who == null) return; + if (who == null || message == "") {Help(p); return; } + if (who.muted) { Player.SendMessage(p, "Cannot impersonate a muted player"); return; } if (p == null || p == who || p.group.Permission > who.group.Permission) { Player.SendChatFrom(who, args[1]);