Fixed replace fainted pokémon twice bug

This commit is contained in:
JappaWakka 2023-02-26 16:05:47 +01:00
parent daef33a886
commit 022597262c
2 changed files with 20 additions and 16 deletions

View File

@ -676,8 +676,8 @@
If BattleScreen.OwnFaint Then
_mainMenuIndex = 0
_mainMenuNextIndex = 0
_mainMenuItemList.Add(New MainMenuItem(1, "Pokémon", 0, AddressOf MainMenuOpenPokemon))
If BattleScreen.IsRemoteBattle AndAlso Not BattleScreen.IsHost Then
_mainMenuItemList.Add(New MainMenuItem(1, "Pokémon", 0, AddressOf MainMenuOpenPokemon))
BattleScreen.OwnFaint = False
End If
ElseIf BattleScreen.OppFaint And BattleScreen.IsRemoteBattle Then
@ -1013,14 +1013,17 @@
Dim Pokemon As Pokemon = Core.Player.Pokemons(PokeIndex)
If PokeIndex = TempBattleScreen.OwnPokemonIndex Then
If Pokemon.Status <> P3D.Pokemon.StatusProblems.Fainted Then
Screen.TextBox.Show(Pokemon.GetDisplayName() & " is already~in battle!", {}, True, False)
Else
Screen.TextBox.Show(Pokemon.GetDisplayName() & " is fainted!", {}, True, False)
End If
Else
If Pokemon.IsEgg() = False Then
If Pokemon.Status <> P3D.Pokemon.StatusProblems.Fainted Then
If BattleCalculation.CanSwitch(TempBattleScreen, True) = False Then
Screen.TextBox.Show(Localization.GetString("battle_main_cannot_switch", "Cannot switch out."), {}, True, False)
Else
If TempBattleScreen.OwnPokemonIndex <> PokeIndex Then
If TempBattleScreen.IsRemoteBattle = True And TempBattleScreen.IsHost = False Then
TempBattleScreen.OppFaint = False
TempBattleScreen.OwnStatistics.Switches += 1
@ -1035,7 +1038,6 @@
TempBattleScreen.Battle.InitializeRound(TempBattleScreen, New Battle.RoundConst With {.StepType = Battle.RoundConst.StepTypes.Switch, .Argument = PokeIndex.ToString()})
End If
End If
End If
Else
Screen.TextBox.Show(Pokemon.GetDisplayName() & " is fainted!", {}, True, False)
End If

View File

@ -94,6 +94,7 @@
ClickHandler(Me)
End If
Me.Visible = False
Exit For
End If
If Controls.Dismiss(True, True, True) = True Then
Me.Index = Me.BackIndex
@ -102,6 +103,7 @@
ClickHandler(Me)
End If
Me.Visible = False
Exit For
End If
Next
End If