From 1c079b7e44642a825888a89259423b3996acf575 Mon Sep 17 00:00:00 2001 From: anth64 Date: Sun, 26 Jul 2026 09:08:08 +0200 Subject: [PATCH] fix: cancel pending actions on group disband even if not yet a claim link --- ClaimLink/ClaimLinkChatCommand.cs | 3 +++ ClaimLink/CommandListener.cs | 7 +++---- 2 files changed, 6 insertions(+), 4 deletions(-) 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)