fix: cancel pending actions on group disband even if not yet a claim link

This commit is contained in:
2026-07-26 09:08:08 +02:00
parent b7ca9fa53b
commit 1c079b7e44
2 changed files with 6 additions and 4 deletions
+3
View File
@@ -285,6 +285,9 @@ public static class ClaimLinkChatCommand
$"'{groupName}' will become a claim link.", $"'{groupName}' will become a claim link.",
() => () =>
{ {
if (!ClaimLinkModSystem.Groups.PlayerGroupsById.ContainsKey(groupId))
return TextCommandResult.Error($"'{groupName}' no longer exists.");
ClaimLinkModSystem.Registry.Add(groupId); ClaimLinkModSystem.Registry.Add(groupId);
return TextCommandResult.Success($"'{groupName}' is now a claim link."); return TextCommandResult.Success($"'{groupName}' is now a claim link.");
} }
+2 -3
View File
@@ -210,10 +210,9 @@ public class GroupCommandListener : ICommandHookListener
if (ClaimLinkModSystem.Groups.PlayerGroupsById.ContainsKey(groupId)) if (ClaimLinkModSystem.Groups.PlayerGroupsById.ContainsKey(groupId))
return; return;
if (!ClaimLinkModSystem.Registry.Exists(groupId))
return;
ClaimLinkChatCommand.RemovePendingActionsForGroup(groupId); ClaimLinkChatCommand.RemovePendingActionsForGroup(groupId);
if (ClaimLinkModSystem.Registry.Exists(groupId))
ClaimLinkModSystem.Registry.Remove(groupId); ClaimLinkModSystem.Registry.Remove(groupId);
} }