Fix /notes not matching properly against own name

This commit is contained in:
UnknownShadow200 2017-04-19 17:01:33 +10:00
parent 73199aa8be
commit 77f5744314

View File

@ -29,14 +29,23 @@ namespace MCGalaxy.Commands {
if (!Server.LogNotes) {
Player.Message(p, "The server does not have notes logging enabled."); return;
}
if (CheckSuper(p, message, "player name")) return;
if (message == "") message = p.name;
string name = PlayerInfo.FindMatchesPreferOnline(p, message);
if (name == null) return;
List<string> notes = Server.Notes.FindMatches(p, message, "notes");
if (notes == null) return;
List<string> notes = new List<string>();
foreach (string note in Server.Notes.Find(name)) {
notes.Add(note);
}
string target = PlayerMetaList.GetName(notes[0]);
Player.Message(p, " Notes for {0}:", PlayerInfo.GetColoredName(p, target));
string target = PlayerInfo.GetColoredName(p, name);
if (notes.Count == 0) {
Player.Message(p, "{0} %Shas no notes.", target); return;
} else {
Player.Message(p, " Notes for {0}:", target);
}
foreach (string line in notes) {
string[] args = line.SplitSpaces();