Skip to content

Commit

Permalink
now give a warning when no pokemon was found within the snipingoffset
Browse files Browse the repository at this point in the history
  • Loading branch information
NecronomiconCoding committed Aug 8, 2016
1 parent 48a4dcc commit b8e880f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion PoGo.NecroBot.Logic/Common/Translations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ public class Translation : ITranslation
new KeyValuePair<TranslationString, string>(TranslationString.SnipeScanEx,
"Sniping a {0} with {1} IV at {2}..."),
new KeyValuePair<TranslationString, string>(TranslationString.NoPokemonToSnipe,
"No Pokemon found to snipe!"),
"Did not find a Pokemon within the SnipingScanOffset!"),
new KeyValuePair<TranslationString, string>(TranslationString.NotEnoughPokeballsToSnipe,
"Not enough Pokeballs to start sniping! ({0}/{1})"),
new KeyValuePair<TranslationString, string>(TranslationString.DisplayHighestMove1Header, "MOVE1"),
Expand Down
10 changes: 10 additions & 0 deletions PoGo.NecroBot.Logic/Tasks/SnipePokemonTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ public static async Task Execute(ISession session, CancellationToken cancellatio
{
var CurrentLatitude = session.Client.CurrentLatitude;
var CurrentLongitude = session.Client.CurrentLongitude;
var catchedPokemon = false;

session.EventDispatcher.Send(new SnipeModeEvent {Active = true});

Expand Down Expand Up @@ -367,6 +368,7 @@ public static async Task Execute(ISession session, CancellationToken cancellatio
});

await CatchPokemonTask.Execute(session, cancellationToken, encounter, pokemon);
catchedPokemon = true;
}
else if (encounter.Status == EncounterResponse.Types.Status.PokemonInventoryFull)
{
Expand Down Expand Up @@ -406,6 +408,14 @@ public static async Task Execute(ISession session, CancellationToken cancellatio
}
}

if (!catchedPokemon)
{
session.EventDispatcher.Send(new SnipeEvent
{
Message = session.Translation.GetTranslation(TranslationString.NoPokemonToSnipe)
});
}

session.EventDispatcher.Send(new SnipeModeEvent {Active = false});
await Task.Delay(session.LogicSettings.DelayBetweenPlayerActions, cancellationToken);
}
Expand Down

0 comments on commit b8e880f

Please sign in to comment.