From 8c5b8aea07c2fcdcaf0a006e1a879d2af8403efc Mon Sep 17 00:00:00 2001 From: ditzy Date: Sun, 11 Feb 2024 23:52:42 -0600 Subject: [PATCH] print error in chat if no mobs in the train are supported by siren --- ScoutHelper/Managers/SirenManager.cs | 4 +++- ScoutHelper/Windows/MainWindow.cs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ScoutHelper/Managers/SirenManager.cs b/ScoutHelper/Managers/SirenManager.cs index 193a6ba..47623be 100644 --- a/ScoutHelper/Managers/SirenManager.cs +++ b/ScoutHelper/Managers/SirenManager.cs @@ -38,7 +38,7 @@ MobManager mobManager (_patchData, _mobToPatch) = LoadData(options.SirenDataFile, territoryManager, mobManager); } - public (string Url, Patch HighestPatch) GenerateSirenLink(IList mobList) { + public Result<(string Url, Patch HighestPatch), string> GenerateSirenLink(IList mobList) { _log.Debug("Generating a siren link for mob list: {0}", mobList); var patches = mobList @@ -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 => { diff --git a/ScoutHelper/Windows/MainWindow.cs b/ScoutHelper/Windows/MainWindow.cs index efab0bd..cd62799 100644 --- a/ScoutHelper/Windows/MainWindow.cs +++ b/ScoutHelper/Windows/MainWindow.cs @@ -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);