diff --git a/P3D/Battle/BattleSystemV2/Battle.vb b/P3D/Battle/BattleSystemV2/Battle.vb index 3be35d01b..3a74d5de3 100644 --- a/P3D/Battle/BattleSystemV2/Battle.vb +++ b/P3D/Battle/BattleSystemV2/Battle.vb @@ -8173,7 +8173,7 @@ End If End If If spikeAffected = True Then - If .FieldEffects.OwnToxicSpikes > 0 And p.Status = Pokemon.StatusProblems.None And p.Type1.Type <> Element.Types.Poison And p.Type2.Type <> Element.Types.Poison Then + If .FieldEffects.OwnToxicSpikes > 0 And p.Status = Pokemon.StatusProblems.None And p.Type1.Type <> Element.Types.Poison And (p.Type2 IsNot Nothing AndAlso p.Type2.Type <> Element.Types.Poison) Then Select Case .FieldEffects.OwnToxicSpikes Case 1 InflictPoison(False, True, BattleScreen, False, "The Toxic Spikes hurt " & p.GetDisplayName() & "!", "toxicspikes") diff --git a/P3D/Battle/BattleSystemV2/FieldEffects.vb b/P3D/Battle/BattleSystemV2/FieldEffects.vb index 40f7ce9cc..de4bce528 100644 --- a/P3D/Battle/BattleSystemV2/FieldEffects.vb +++ b/P3D/Battle/BattleSystemV2/FieldEffects.vb @@ -387,7 +387,7 @@ End If Else p = BattleScreen.OppPokemon - If p.Type1.Type = Element.Types.Flying Or p.Type2.Type = Element.Types.Flying Or p.Ability.Name.ToLower() = "levitate" And BattleScreen.FieldEffects.CanUseAbility(False, BattleScreen) = True Then + If p.Type1.Type = Element.Types.Flying Or (p.Type2 IsNot Nothing AndAlso p.Type2.Type = Element.Types.Flying) Or p.Ability.Name.ToLower() = "levitate" And BattleScreen.FieldEffects.CanUseAbility(False, BattleScreen) = True Then grounded = False End If If BattleScreen.FieldEffects.Gravity > 0 Or BattleScreen.FieldEffects.OppSmacked > 0 Or BattleScreen.FieldEffects.OppIngrain > 0 Then diff --git a/P3D/Screens/Pokedex/PokedexScreen.vb b/P3D/Screens/Pokedex/PokedexScreen.vb index af248a2dc..26668d38a 100644 --- a/P3D/Screens/Pokedex/PokedexScreen.vb +++ b/P3D/Screens/Pokedex/PokedexScreen.vb @@ -745,7 +745,7 @@ Public Class PokedexScreen Core.SpriteBatch.DrawString(FontManager.MainFont, p.PokedexEntry.Weight & " kg", New Vector2(850, 430), Color.Black) Core.SpriteBatch.Draw(TextureManager.GetTexture("GUI\Menus\Types"), New Rectangle(850, 356, 48, 16), p.Type1.GetElementImage(), Color.White) - If p.Type2.Type <> Element.Types.Blank Then + If p.Type2 IsNot Nothing AndAlso p.Type2.Type <> Element.Types.Blank Then Core.SpriteBatch.Draw(TextureManager.GetTexture("GUI\Menus\Types"), New Rectangle(900, 356, 48, 16), p.Type2.GetElementImage(), Color.White) End If @@ -1747,7 +1747,7 @@ Public Class PokedexViewScreen Core.SpriteBatch.DrawString(FontManager.MainFont, Pokemon.PokedexEntry.Height & " m", New Vector2(CInt(mV.X + 250), CInt(mV.Y - 152)), Color.Black) Core.SpriteBatch.DrawString(FontManager.MainFont, Pokemon.PokedexEntry.Weight & " kg", New Vector2(CInt(mV.X + 250), CInt(mV.Y + 128)), Color.Black) Core.SpriteBatch.DrawString(FontManager.MainFont, Pokemon.PokedexEntry.Species, New Vector2(CInt(mV.X - 248 - FontManager.MainFont.MeasureString(Pokemon.PokedexEntry.Species).X), CInt(mV.Y - 152)), Color.Black) - If Pokemon.Type2.Type <> Element.Types.Blank Then + If Pokemon.Type2 IsNot Nothing AndAlso Pokemon.Type2.Type <> Element.Types.Blank Then Core.SpriteBatch.Draw(TextureManager.GetTexture("GUI\Menus\Types"), New Rectangle(CInt(mV.X - 450), CInt(mV.Y + 123), 96, 32), Pokemon.Type1.GetElementImage(), Color.White) Core.SpriteBatch.Draw(TextureManager.GetTexture("GUI\Menus\Types"), New Rectangle(CInt(mV.X - 350), CInt(mV.Y + 123), 96, 32), Pokemon.Type2.GetElementImage(), Color.White) Else