From ecb70dc4a90011922ecc1a2e9e0b01d7607bdf76 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Wed, 13 Jul 2022 15:02:45 -0400 Subject: [PATCH] Fixes default commands not working like .modify speed 5 --- Source/Game/Chat/CommandManager.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Source/Game/Chat/CommandManager.cs b/Source/Game/Chat/CommandManager.cs index 0463c38eb..b39697f84 100644 --- a/Source/Game/Chat/CommandManager.cs +++ b/Source/Game/Chat/CommandManager.cs @@ -383,8 +383,19 @@ namespace Game.Chat public void AddSubCommand(ChatCommandNode command) { - if (!_subCommands.TryAdd(command._name, command)) - Log.outError(LogFilter.Commands, $"Error trying to add subcommand, Already exists Command: {_name} SubCommand: {command._name}"); + if (command._name.IsEmpty()) + { + _permission = command._permission; + _helpText = command._helpText; + _helpString = command._helpString; + _methodInfo = command._methodInfo; + parameterTypes = command.parameterTypes; + } + else + { + if (!_subCommands.TryAdd(command._name, command)) + Log.outError(LogFilter.Commands, $"Error trying to add subcommand, Already exists Command: {_name} SubCommand: {command._name}"); + } } public bool Invoke(CommandHandler handler, StringArguments args)