Merge pull request #138 from Peteys93/master

Impersonate bug fixes
This commit is contained in:
Unkie 2016-04-22 12:36:38 +10:00
commit 4bbad05ad2

View File

@ -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]);