Fix /ccols edit not working with non-ascii colour codes (Thanks Desaxu)

This commit is contained in:
UnknownShadow200 2021-05-27 20:32:32 +10:00
parent c22cd55997
commit 024f7d4e91
2 changed files with 3 additions and 2 deletions

View File

@ -166,8 +166,9 @@ namespace MCGalaxy.Gui.Components {
if (c == 'S' || c == 'f' || c == 'F' || c == '0') return foreCol;
Colors.Map(ref c);
if (!Colors.IsDefined(c)) return foreCol;
ColorDesc col = Colors.Get(c);
if (col.Undefined) return foreCol;
return Color.FromArgb(col.R, col.G, col.B);
}
}

View File

@ -99,7 +99,7 @@ namespace MCGalaxy.Commands.CPE {
char code = ParseColor(p, args[1]);
if (code == '\0') return;
ColorDesc col = Colors.List[code];
ColorDesc col = Colors.Get(code);
if (args[2].CaselessEq("name")) {
if (!CheckName(p, args[3])) return;