diff --git a/P3D/Overworld/OverworldScreen.vb b/P3D/Overworld/OverworldScreen.vb index 2cac597b6..a6319a8cc 100644 --- a/P3D/Overworld/OverworldScreen.vb +++ b/P3D/Overworld/OverworldScreen.vb @@ -473,6 +473,15 @@ Public Class OverworldScreen ActionScript.StartScript(AfterRoamingBattleScript, 0,,, "AfterRoamingBattleScript") AfterRoamingBattleScript = "" End If + If Core.Player.CheckForTrainersLater = True Then + Screen.Level.CheckTrainerSights() + If CurrentScreen.Identification = Screen.Identifications.OverworldScreen Then + If CType(CurrentScreen, OverworldScreen).ActionScript.IsReady = False Then + Core.Player._stepEventStartedTrainer = True + End If + End If + Core.Player.CheckForTrainersLater = False + End If End Sub ''' diff --git a/P3D/Player/Player.vb b/P3D/Player/Player.vb index c4ea0ddc5..6286a36b6 100644 --- a/P3D/Player/Player.vb +++ b/P3D/Player/Player.vb @@ -390,6 +390,7 @@ Public TempSurfSkin As String = "Hilbert" Public TempRideSkin As String = "" Public Statistics As String = "" + Public CheckForTrainersLater As Boolean = False 'Secure fields: Private _name As String = "" @@ -1628,7 +1629,7 @@ ' - add to the Temp map step count ' - track the statistic for walked steps. - Private _stepEventStartedTrainer As Boolean = False + Public _stepEventStartedTrainer As Boolean = False Private _stepEventRepelMessage As Boolean = False Private _stepEventEggHatched As Boolean = False @@ -1687,7 +1688,7 @@ End If End Sub - Private Sub StepEventCheckTrainers() + Public Sub StepEventCheckTrainers() If CanFireStepEvent() = True Then Screen.Level.CheckTrainerSights() If CurrentScreen.Identification = Screen.Identifications.OverworldScreen Then @@ -1695,6 +1696,10 @@ _stepEventStartedTrainer = True End If End If + Else + If Screen.Level.PokemonEncounterData.EncounteredPokemon = True OrElse (CurrentScreen.Identification = Screen.Identifications.OverworldScreen AndAlso CType(CurrentScreen, OverworldScreen).TrainerEncountered = True) Then + CheckForTrainersLater = True + End If End If End Sub