Skip to content

Commit

Permalink
Some users have a setup where the brackets are not shown in the caption.
Browse files Browse the repository at this point in the history
  • Loading branch information
Viir committed Sep 8, 2016
1 parent 3ccc8d5 commit 0a07d54
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/Sanderling.ABot/Bot/Task/SaveShip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,17 @@ public IEnumerable<IBotTask> 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;

Expand Down

0 comments on commit 0a07d54

Please sign in to comment.