From b75de6fe5e8c589bf692a45009ca9222c748af6e Mon Sep 17 00:00:00 2001 From: JappaWakka Date: Thu, 23 Feb 2023 12:27:48 +0100 Subject: [PATCH] Fixed BattleMapOffset not being set to 0 --- P3D/Battle/BattleSystemV2/Battle.vb | 1 + P3D/Battle/BattleSystemV2/BattleScreen.vb | 2 ++ .../BattleSystemV2/QueryObjects/SwitchPokemonQueryObject.vb | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/P3D/Battle/BattleSystemV2/Battle.vb b/P3D/Battle/BattleSystemV2/Battle.vb index 6d01fdd03..dc4248dda 100644 --- a/P3D/Battle/BattleSystemV2/Battle.vb +++ b/P3D/Battle/BattleSystemV2/Battle.vb @@ -7895,6 +7895,7 @@ BattleScreen.BattleQuery.Add(New TextQueryObject(BattleScreen.Trainer.Name & ": ""Go, " & BattleScreen.OppPokemon.GetDisplayName() & "!""")) Dim BallThrow As AnimationQueryObject = New AnimationQueryObject(BattleScreen.OppPokemonNPC, False) + BattleScreen.OppPokemonNPC.Position.Y = 0 + BattleScreen.BattleMapOffset.Y If Core.Player.ShowBattleAnimations <> 0 AndAlso BattleScreen.IsPVPBattle = False Then ' Ball is thrown diff --git a/P3D/Battle/BattleSystemV2/BattleScreen.vb b/P3D/Battle/BattleSystemV2/BattleScreen.vb index 910918304..100aa9203 100644 --- a/P3D/Battle/BattleSystemV2/BattleScreen.vb +++ b/P3D/Battle/BattleSystemV2/BattleScreen.vb @@ -813,6 +813,8 @@ levelfile = battleMapData(0) BattleMapOffset = New Vector3(CSng(battleMapData(1).Replace(".", GameController.DecSeparator)), CSng(battleMapData(2).Replace(".", GameController.DecSeparator)), CSng(battleMapData(3).Replace(".", GameController.DecSeparator))) End Select + Else + BattleMapOffset = New Vector3(0) End If If File.Exists(GameController.GamePath & "\Content\Data\maps\battle\" & levelfile) = False And File.Exists(GameController.GamePath & GameModeManager.ActiveGameMode.MapPath & "battle\" & levelfile) = False Then diff --git a/P3D/Battle/BattleSystemV2/QueryObjects/SwitchPokemonQueryObject.vb b/P3D/Battle/BattleSystemV2/QueryObjects/SwitchPokemonQueryObject.vb index 9efb511d7..b93a1dcb6 100644 --- a/P3D/Battle/BattleSystemV2/QueryObjects/SwitchPokemonQueryObject.vb +++ b/P3D/Battle/BattleSystemV2/QueryObjects/SwitchPokemonQueryObject.vb @@ -231,7 +231,7 @@ Dim delay As Single = 2.0F Public Sub FinishOppSwitch(BattleScreen As BattleScreen) - BattleScreen.OppPokemonNPC.Position.Y = 0 + BattleScreen.OppPokemonNPC.Position.Y = 0 + BattleScreen.BattleMapOffset.Y BattleScreen.Battle.ChangeCameraAngle(1, False, BattleScreen) Dim oppModel As String = BattleScreen.GetModelName(False) If oppModel = "" Then