From d9eb12d341db3dcb651eb065ba173a5cfc16fa36 Mon Sep 17 00:00:00 2001 From: JappaWakka Date: Sun, 3 Sep 2023 16:39:48 +0200 Subject: [PATCH] Fix for softlocks and other battle bugs --- P3D/Battle/BattleSystemV2/Battle.vb | 1 - P3D/Battle/BattleSystemV2/BattleScreen.vb | 8 +++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/P3D/Battle/BattleSystemV2/Battle.vb b/P3D/Battle/BattleSystemV2/Battle.vb index 8b2b9870f..e6781305d 100644 --- a/P3D/Battle/BattleSystemV2/Battle.vb +++ b/P3D/Battle/BattleSystemV2/Battle.vb @@ -8166,7 +8166,6 @@ If Core.Player.BattleStyle = 1 OrElse BattleScreen.IsPVPBattle = True Then BattleScreen.HasSwitchedOwn = False - StartRound(BattleScreen) End If End With End If diff --git a/P3D/Battle/BattleSystemV2/BattleScreen.vb b/P3D/Battle/BattleSystemV2/BattleScreen.vb index a8a172088..07fa69de3 100644 --- a/P3D/Battle/BattleSystemV2/BattleScreen.vb +++ b/P3D/Battle/BattleSystemV2/BattleScreen.vb @@ -327,6 +327,7 @@ If IsPVPBattle = False And IsRemoteBattle = False Then PlayerStatistics.Track("Trainer battles", 1) Else + FieldEffects.Weather = BattleWeather.WeatherTypes.Clear TempPVPBattleQuery.Clear() End If @@ -1154,6 +1155,11 @@ nextIndex: End If End If + If BattleQuery.Count = 0 Then + For i = 0 To 99 + InsertCasualCameramove() + Next + End If 'Update the world: Screen.Level.World.Initialize(Screen.Level.EnvironmentType, World.GetWeatherTypeFromWeather(Screen.Level.World.CurrentMapWeather)) End Sub @@ -1848,7 +1854,6 @@ nextIndex: Else BV2Screen.BattleMenu.Visible = True End If - BV2Screen.TempPVPBattleQuery.Clear() End Sub 'Sends some variables that let the client know the current state of the battle @@ -1922,6 +1927,7 @@ nextIndex: End If Core.ServersManager.ServerConnection.SendPackage(New Servers.Package(Servers.Package.PackageTypes.BattleHostData, Core.ServersManager.ID, Servers.Package.ProtocolTypes.TCP, {PartnerNetworkID.ToString(), d}.ToList())) SentHostData = True + TempPVPBattleQuery.Clear() End Sub #End Region