From 17ef30605c2a47f067577bb779ea425464e8e7c6 Mon Sep 17 00:00:00 2001 From: JappaWakka Date: Sat, 1 Apr 2023 09:15:57 +0200 Subject: [PATCH] Fixed wrong bugcatchingconstest item pickup type.. By adding the IsOutside map Property --- P3D/Content/Data/maps/nationalpark/contest.dat | 2 +- P3D/Pokemon/Monster/PokemonInteractions.vb | 2 +- P3D/World/Level.vb | 13 +++++++++++++ P3D/World/LevelLoader.vb | 6 ++++++ 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/P3D/Content/Data/maps/nationalpark/contest.dat b/P3D/Content/Data/maps/nationalpark/contest.dat index 6916d3c7e..be6a41a88 100644 --- a/P3D/Content/Data/maps/nationalpark/contest.dat +++ b/P3D/Content/Data/maps/nationalpark/contest.dat @@ -1,5 +1,5 @@ {"Level"{LEV[{"Name"{str[National Park]}}{"MusicLoop"{str[bugcontest]}}]}} -{"Actions"{LEV[{"CanTeleport"{bool[0]}}{"CanDig"{bool[0]}}{"CanFly"{bool[0]}}{"EnvironmentType"{int[0]}}{"Weather"{int[0]}}{"Lighting"{int[0]}}{"BugCatchingContest"{str[nationalpark\end_contest_menu,nationalpark\sport_balls,Sport Balls]}}]}} +{"Actions"{LEV[{"CanTeleport"{bool[0]}}{"CanDig"{bool[0]}}{"CanFly"{bool[0]}}{"IsOutside"{bool[1]}}{"EnvironmentType"{int[0]}}{"Weather"{int[0]}}{"Lighting"{int[0]}}{"BugCatchingContest"{str[nationalpark\end_contest_menu,nationalpark\sport_balls,Sport Balls]}}]}} Floor: Grass: diff --git a/P3D/Pokemon/Monster/PokemonInteractions.vb b/P3D/Pokemon/Monster/PokemonInteractions.vb index 8245d1e62..8867078c7 100644 --- a/P3D/Pokemon/Monster/PokemonInteractions.vb +++ b/P3D/Pokemon/Monster/PokemonInteractions.vb @@ -1062,7 +1062,7 @@ #Region "Checks" Private Shared Function IsOutside() As Boolean - If Screen.Level.CanFly = True And Screen.Level.CanDig = False And Screen.Level.CanTeleport = True Then + If Screen.Level.IsOutside = True OrElse Screen.Level.CanFly = True And Screen.Level.CanDig = False And Screen.Level.CanTeleport = True Then Return True End If Return False diff --git a/P3D/World/Level.vb b/P3D/World/Level.vb index ee3cf091d..93cebf189 100644 --- a/P3D/World/Level.vb +++ b/P3D/World/Level.vb @@ -51,6 +51,7 @@ Public Class Level Private _hiddenabilitychance As Integer = 0 Private _lightingType As Integer = 0 Private _isSafariZone As Boolean = False + Private _isOutside As Boolean = False Private _isBugCatchingContest As Boolean = False Private _bugCatchingContestData As String = "" @@ -538,6 +539,18 @@ Public Class Level End Set End Property + ''' + ''' Overrides whether the map is outside. Affects item pickup interaction. + ''' + Public Property IsOutside As Boolean + Get + Return Me._isOutside + End Get + Set(value As Boolean) + Me._isOutside = value + End Set + End Property + ''' ''' Whether the map is a part of the Bug Catching Contest. This changes the Battle Menu and the Menu Screen. ''' diff --git a/P3D/World/LevelLoader.vb b/P3D/World/LevelLoader.vb index e101563ec..cf10fa96b 100644 --- a/P3D/World/LevelLoader.vb +++ b/P3D/World/LevelLoader.vb @@ -1086,6 +1086,12 @@ Screen.Level.IsSafariZone = False End If + If TagExists(Tags, "IsOutside") = True Then + Screen.Level.IsOutside = CBool(GetTag(Tags, "IsOutside")) + Else + Screen.Level.IsOutside = False + End If + If TagExists(Tags, "BugCatchingContest") = True Then Screen.Level.IsBugCatchingContest = True Screen.Level.BugCatchingContestData = CStr(GetTag(Tags, "BugCatchingContest"))