Hopefully fix berrydata bugs with new saves

This commit is contained in:
JappaWakka 2023-07-15 14:17:40 +02:00
parent 29a9ec6ebb
commit 6440ff0466
3 changed files with 17 additions and 7 deletions

View File

@ -613,7 +613,7 @@ Namespace GameJolt
Dim data As String = result.Remove(0, 22)
data = data.Remove(data.LastIndexOf(""""))
_berries = data.Replace("\""", """")
_berries = data.Replace("\""", """").Replace("}{", "}" & Environment.NewLine & "{")
Else
_berries = GetBerryData()
End If
@ -947,8 +947,11 @@ Namespace GameJolt
If File.Exists(GameModeManager.GetContentFilePath("Data\BerryData.dat")) Then
Dim Berries() As String = System.IO.File.ReadAllLines(GameModeManager.GetContentFilePath("Data\BerryData.dat"))
For Each line In Berries
s &= line
For i = 0 To Berries.Count - 1
s &= Berries(i)
If i < Berries.Count - 1 Then
s &= Environment.NewLine
End If
Next
Else
s = "{route29.dat|13,0,5|6|2|0|2012,9,21,4,0,0|1}" & Environment.NewLine &

View File

@ -170,6 +170,7 @@
Core.Player.startRiding = False
Core.Player.startRotation = CSng(MathHelper.Pi * (rot / 2))
Core.Player.PokedexData = Pokedex.NewPokedex()
Core.Player.BerryData = CreateBerryData()
Core.Player.AddVisitedMap(map)
Core.Player.SaveCreated = GameController.GAMEDEVELOPMENTSTAGE & " " & GameController.GAMEVERSION
@ -193,8 +194,11 @@
If File.Exists(GameModeManager.GetContentFilePath("Data\BerryData.dat")) Then
Dim Berries() As String = System.IO.File.ReadAllLines(GameModeManager.GetContentFilePath("Data\BerryData.dat"))
For Each line In Berries
s &= line
For i = 0 To Berries.Count - 1
s &= Berries(i)
If i < Berries.Count - 1 Then
s &= Environment.NewLine
End If
Next
Else
s = "{route29.dat|13,0,5|6|2|0|2012,9,21,4,0,0|1}" & Environment.NewLine &

View File

@ -446,8 +446,11 @@
If File.Exists(GameModeManager.GetContentFilePath("Data\BerryData.dat")) Then
Dim Berries() As String = System.IO.File.ReadAllLines(GameModeManager.GetContentFilePath("Data\BerryData.dat"))
For Each line In Berries
s &= line
For i = 0 To Berries.Count - 1
s &= Berries(i)
If i < Berries.Count - 1 Then
s &= Environment.NewLine
End If
Next
Else
s = "{route29.dat|13,0,5|6|2|0|2012,9,21,4,0,0|1}" & Environment.NewLine &