Skip to content

Commit

Permalink
print error in chat if no mobs in the train are supported by siren
Browse files Browse the repository at this point in the history
  • Loading branch information
dit-zy committed Feb 12, 2024
1 parent 7c85fd3 commit 8c5b8ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion ScoutHelper/Managers/SirenManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ MobManager mobManager
(_patchData, _mobToPatch) = LoadData(options.SirenDataFile, territoryManager, mobManager);
}

public (string Url, Patch HighestPatch) GenerateSirenLink(IList<TrainMob> mobList) {
public Result<(string Url, Patch HighestPatch), string> GenerateSirenLink(IList<TrainMob> mobList) {
_log.Debug("Generating a siren link for mob list: {0}", mobList);

var patches = mobList
Expand All @@ -50,6 +50,8 @@ MobManager mobManager

_log.Debug("Patches represented in mob list: {0}", patches);

if (patches.IsEmpty()) return "No mobs in the train are supported by Siren Hunts ;-;";

var fullPath = patches
.Select(
patch => {
Expand Down
2 changes: 1 addition & 1 deletion ScoutHelper/Windows/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ private void GenerateSirenLink() {
train => 0 < train.Count,
"No mobs in the train :T"
)
.Map(
.Bind(
train => {
trainList = train;
return _sirenManager.GenerateSirenLink(train);
Expand Down

0 comments on commit 8c5b8ae

Please sign in to comment.