Prevent collection modification.

This commit is contained in:
atom0s 2014-05-26 16:50:41 -07:00
parent 99de841f5d
commit 7f65e66d83

View file

@ -567,7 +567,7 @@ namespace TShockAPI
string cmdName = args[0].ToLower();
args.RemoveAt(0);
IEnumerable<Command> cmds = ChatCommands.Where(c => c.HasAlias(cmdName));
IEnumerable<Command> cmds = ChatCommands.Where(c => c.HasAlias(cmdName)).ToList();
if (Hooks.PlayerHooks.OnPlayerCommand(player, cmdName, cmdText, args, ref cmds))
return true;