mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-23 04:32:50 -04:00
few less allocations
This commit is contained in:
parent
bb8c39dc12
commit
66ce425c77
@ -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();
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user