Skip to content

Commit

Permalink
add a clarifying comment to the /phb next code
Browse files Browse the repository at this point in the history
Just to avoid confusion, I added a comment that explains two blocks that first glance would suggest could be merged into a single if/elseif but that really can't.
  • Loading branch information
PrincessRTFM authored Nov 6, 2023
1 parent af0b20f commit 1a2cca5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions HuntBuddy/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ public unsafe void PluginCommand(string command, string args)
.Where(filterPredicate)
.ToList()
: new List<MobHuntEntry>();
// if we didn't find any candidates, we try a different method to fill it
if (candidates.Count == 0)
{
PluginLog.Information("Nothing available in current expansion, looking globally");
Expand All @@ -180,6 +181,9 @@ public unsafe void PluginCommand(string command, string args)
.Where(filterPredicate)
.ToList();
}
// regardless of HOW we got our candidates, assuming we did in fact get them, we pick one
// note that this can't be merged into the above block because the above MAY run, and if so MUST run first,
// but this block must ALWAYS run, regardless
if (candidates.Count >= 1)
{
PluginLog.Information($"Found {candidates.Count}");
Expand Down

0 comments on commit 1a2cca5

Please sign in to comment.