diff --git a/src/Sanderling.ABot/Bot/Task/SaveShip.cs b/src/Sanderling.ABot/Bot/Task/SaveShip.cs index dba704f..69febe7 100644 --- a/src/Sanderling.ABot/Bot/Task/SaveShip.cs +++ b/src/Sanderling.ABot/Bot/Task/SaveShip.cs @@ -42,7 +42,17 @@ public IEnumerable Component var charIsLocatedInHighsec = 500 < memoryMeasurement?.InfoPanelCurrentSystem?.SecurityLevelMilli; - var localChatWindow = memoryMeasurement?.WindowChatChannel?.FirstOrDefault(window => window?.Caption?.RegexMatchSuccessIgnoreCase(@"local\s*\[") ?? false); + var setLocalChatWindowCandidate = + memoryMeasurement?.WindowChatChannel + ?.Where(window => window?.Caption?.RegexMatchSuccessIgnoreCase(@"local") ?? false) + ?.ToArray(); + + if (1 < setLocalChatWindowCandidate?.Length) + { + // TODO:Report to user we cannot identify the local chat window. + } + + var localChatWindow = setLocalChatWindowCandidate?.FirstOrDefault(); var sessionDurationSufficient = AllowRoamSessionDurationMin <= memoryMeasurement?.SessionDurationRemaining;