Merge pull request #11543 from Phrohdoh/chatcommands-no-dupes

Allow overriding previously registered chatcommands
This commit is contained in:
reaperrr
2016-07-03 16:48:35 +02:00
committed by GitHub
2 changed files with 3 additions and 2 deletions

View File

@@ -48,7 +48,8 @@ namespace OpenRA.Mods.Common.Commands
public void RegisterCommand(string name, IChatCommand command)
{
Commands.Add(name.ToLowerInvariant(), command);
// Override possible duplicates instead of crashing.
Commands[name.ToLowerInvariant()] = command;
}
}

View File

@@ -55,7 +55,7 @@ namespace OpenRA.Mods.Common.Commands
public void RegisterHelp(string name, string description)
{
helpDescriptions.Add(name, description);
helpDescriptions[name] = description;
}
}
}