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 (Regex.IsMatch(message, "&a")) break;
if ( lines.Count > 0 ) { if ( lines.Count > 0 ) {
if ( message[0].ToString() == "&" ) if ( message[0] == '&' )
message = "> " + message.Trim(); message = "> " + message.Trim();
else else
message = "> " + color + message.Trim(); message = "> " + color + message.Trim();

View File

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

View File

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