few less allocations

This commit is contained in:
UnknownShadow200 2017-08-10 13:40:45 +10:00
parent bb8c39dc12
commit 66ce425c77
3 changed files with 5 additions and 5 deletions

View File

@ -31,7 +31,7 @@ namespace MCGalaxy {
//if (Regex.IsMatch(message, "&a")) break;
if ( lines.Count > 0 ) {
if ( message[0].ToString() == "&" )
if ( message[0] == '&' )
message = "> " + message.Trim();
else
message = "> " + color + message.Trim();

View File

@ -53,13 +53,13 @@ namespace MCGalaxy.Commands.Bots {
}
string ai = args[1].ToLower();
if (ai == "hunt") {
if (ai.CaselessEq("hunt")) {
bot.hunt = !bot.hunt;
bot.Instructions.Clear();
bot.AIName = "";
UpdateBot(p, bot, "'s hunt instinct: " + bot.hunt);
return;
} else if (ai == "kill") {
} else if (ai.CaselessEq("kill")) {
if (!CheckExtraPerm(p)) { MessageNeedExtra(p, 1); return; }
bot.kill = !bot.kill;
UpdateBot(p, bot, "'s kill instinct: " + bot.kill);

View File

@ -85,8 +85,8 @@ namespace MCGalaxy {
List<string> maps = AutoloadMaps.AllNames();
foreach (string map in maps) {
string name = map.ToLower();
if (name != mainLevel.name) CmdLoad.LoadLevel(null, name);
if (map.CaselessEq(mainLevel.name)) continue;
CmdLoad.LoadLevel(null, map);
}
}