diff --git a/ClaimLink/ClaimLinkChatCommand.cs b/ClaimLink/ClaimLinkChatCommand.cs index 3f27637..ad94de9 100644 --- a/ClaimLink/ClaimLinkChatCommand.cs +++ b/ClaimLink/ClaimLinkChatCommand.cs @@ -285,6 +285,9 @@ public static class ClaimLinkChatCommand $"'{groupName}' will become a claim link.", () => { + if (!ClaimLinkModSystem.Groups.PlayerGroupsById.ContainsKey(groupId)) + return TextCommandResult.Error($"'{groupName}' no longer exists."); + ClaimLinkModSystem.Registry.Add(groupId); return TextCommandResult.Success($"'{groupName}' is now a claim link."); } diff --git a/ClaimLink/CommandListener.cs b/ClaimLink/CommandListener.cs index 60fd6eb..e2b8d02 100644 --- a/ClaimLink/CommandListener.cs +++ b/ClaimLink/CommandListener.cs @@ -210,11 +210,10 @@ public class GroupCommandListener : ICommandHookListener if (ClaimLinkModSystem.Groups.PlayerGroupsById.ContainsKey(groupId)) return; - if (!ClaimLinkModSystem.Registry.Exists(groupId)) - return; - ClaimLinkChatCommand.RemovePendingActionsForGroup(groupId); - ClaimLinkModSystem.Registry.Remove(groupId); + + if (ClaimLinkModSystem.Registry.Exists(groupId)) + ClaimLinkModSystem.Registry.Remove(groupId); } internal static void OnPlayerDisconnect(IServerPlayer player)