Remove command from assembly map when removed from command map (#2183)

This commit is contained in:
Blair 2025-03-13 08:26:37 +10:00 committed by GitHub
parent 3a990b77f0
commit e47b816495
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -10,6 +10,7 @@ using Dalamud.IoC.Internal;
using Dalamud.Logging.Internal; using Dalamud.Logging.Internal;
using Dalamud.Plugin.Internal.Types; using Dalamud.Plugin.Internal.Types;
using Dalamud.Plugin.Services; using Dalamud.Plugin.Services;
using Dalamud.Utility;
using FFXIVClientStructs.FFXIV.Client.System.String; using FFXIVClientStructs.FFXIV.Client.System.String;
using FFXIVClientStructs.FFXIV.Client.UI; using FFXIVClientStructs.FFXIV.Client.UI;
@ -149,6 +150,11 @@ internal sealed unsafe class CommandManager : IInternalDisposableService, IComma
/// <inheritdoc/> /// <inheritdoc/>
public bool RemoveHandler(string command) public bool RemoveHandler(string command)
{ {
if (this.commandAssemblyNameMap.FindFirst(c => c.Key.Item1 == command, out var assemblyKeyValuePair))
{
this.commandAssemblyNameMap.TryRemove(assemblyKeyValuePair.Key, out _);
}
return this.commandMap.Remove(command, out _); return this.commandMap.Remove(command, out _);
} }