diff --git a/P3D/Overworld/BackdropRenderer.vb b/P3D/Overworld/BackdropRenderer.vb index 4b944c503..8ac8ace28 100644 --- a/P3D/Overworld/BackdropRenderer.vb +++ b/P3D/Overworld/BackdropRenderer.vb @@ -184,7 +184,7 @@ Dim dayColor As Vector3 = Vector3.One Dim diffuseColor As Vector3 = Screen.Effect.DiffuseColor - If Not Screen.Level.World Is Nothing Then + If Screen.Level.World IsNot Nothing Then Select Case Screen.Level.World.EnvironmentType Case P3D.World.EnvironmentTypes.Outside dayColor = SkyDome.GetDaytimeColor(True).ToVector3() diff --git a/P3D/Overworld/Minimap.vb b/P3D/Overworld/Minimap.vb index 1684e0090..248dfaa1c 100644 --- a/P3D/Overworld/Minimap.vb +++ b/P3D/Overworld/Minimap.vb @@ -70,7 +70,7 @@ If dontDraw.Contains(e.EntityID) = False Then Dim t As Texture2D = GetTextureFromEntity(e) - If Not t Is Nothing Then + If t IsNot Nothing Then Dim sO As Vector2 = GetScaleOffset(e.Scale) Me.Squares.Add(New MinimapSquare(New Rectangle(CInt((e.Position.X + sO.X) * ObjectScale), CInt((e.Position.Z + sO.Y) * ObjectScale), CInt(e.Scale.X * ObjectScale), CInt(e.Scale.Z * ObjectScale)), Color.Black, t, DrawTextures)) diff --git a/P3D/Player/Player.vb b/P3D/Player/Player.vb index 28df664f1..543fe44ff 100644 --- a/P3D/Player/Player.vb +++ b/P3D/Player/Player.vb @@ -727,7 +727,7 @@ Data = IO.File.ReadAllText(GameController.GamePath & "\Save\" & filePrefix & "\Player.dat").SplitAtNewline() End If - If Not Screen.Level Is Nothing Then + If Screen.Level IsNot Nothing Then Screen.Level.Riding = False End If @@ -1869,7 +1869,7 @@ If Random.Next(0, 193) = 0 Then Dim p As Pokemon = Spawner.GetPokemon(Screen.Level.LevelFile, Spawner.EncounterMethods.Land, False, "") - If Not p Is Nothing Then + If p IsNot Nothing Then PlayWildPokemonNoise(p.Number) End If End If @@ -1878,7 +1878,7 @@ If Random.Next(0, 193) = 0 Then Dim p As Pokemon = Spawner.GetPokemon(Screen.Level.LevelFile, Spawner.EncounterMethods.Land, False, "") - If Not p Is Nothing Then + If p IsNot Nothing Then PlayWildPokemonNoise(p.Number) Exit Sub End If @@ -1888,7 +1888,7 @@ If Random.Next(0, 193) = 0 Then Dim p As Pokemon = Spawner.GetPokemon(Screen.Level.LevelFile, Spawner.EncounterMethods.Surfing, False, "") - If Not p Is Nothing Then + If p IsNot Nothing Then PlayWildPokemonNoise(p.Number) Exit Sub End If diff --git a/P3D/Screens/BattleIntroScreen.vb b/P3D/Screens/BattleIntroScreen.vb index 5a44c3edc..2ac4da0ac 100644 --- a/P3D/Screens/BattleIntroScreen.vb +++ b/P3D/Screens/BattleIntroScreen.vb @@ -114,7 +114,7 @@ Dim currentBlurZoom As Integer = 0 Private Sub DrawBlurIntro() - If Not blurTexture Is Nothing Then + If blurTexture IsNot Nothing Then Dim startIndex As Integer = 0 If blurLayers.Count > 10 Then startIndex = blurLayers.Count - 10 @@ -188,7 +188,7 @@ If Trainer.GameJoltID <> "" Then If GameJolt.Emblem.HasDownloadedSprite(Trainer.GameJoltID) = True Then Dim t As Texture2D = GameJolt.Emblem.GetOnlineSprite(Trainer.GameJoltID) - If Not t Is Nothing Then + If t IsNot Nothing Then Dim spriteSize As New Vector2(t.Width / 3.0F, t.Height / 4.0F) t3 = TextureManager.GetTexture(t, New Rectangle(0, CInt(spriteSize.Y * 2), CInt(spriteSize.X), CInt(spriteSize.Y))) End If @@ -250,7 +250,7 @@ If Trainer.GameJoltID <> "" Then If GameJolt.Emblem.HasDownloadedSprite(Trainer.GameJoltID) = True Then Dim t As Texture2D = GameJolt.Emblem.GetOnlineSprite(Trainer.GameJoltID) - If Not t Is Nothing Then + If t IsNot Nothing Then Dim spriteSize As New Vector2(t.Width / 3.0F, t.Height / 4.0F) t3 = TextureManager.GetTexture(t, New Rectangle(0, CInt(spriteSize.Y * 2), CInt(spriteSize.X), CInt(spriteSize.Y))) End If @@ -506,7 +506,7 @@ Player.Temp.BeforeBattleFacing = Screen.Camera.GetPlayerFacingDirection() MusicManager.Play(MusicLoop, False, 0F, False) - If Not MusicManager.CurrentSong Is Nothing Then + If MusicManager.CurrentSong IsNot Nothing Then Me.duration = MusicManager.CurrentSong.Duration Else Me.duration = New TimeSpan(0) diff --git a/P3D/World/Level.vb b/P3D/World/Level.vb index b5c55cd2b..c75bfb41d 100644 --- a/P3D/World/Level.vb +++ b/P3D/World/Level.vb @@ -671,7 +671,7 @@ Public Class Level ''' Initializes the offset map update cycle. ''' Public Sub StartOffsetMapUpdate() - If Not Me._offsetTimer Is Nothing Then + If Me._offsetTimer IsNot Nothing Then Me._offsetTimer.Stop() End If @@ -901,7 +901,7 @@ Public Class Level ' Render floors: For i = 0 To Me.OffsetmapFloors.Count - 1 If i <= Me.OffsetmapFloors.Count - 1 Then - If Not Me.OffsetmapFloors(i) Is Nothing Then + If Me.OffsetmapFloors(i) IsNot Nothing Then Me.OffsetmapFloors(i).Render() DebugDisplay.MaxVertices += Me.OffsetmapFloors(i).VertexCount End If @@ -911,7 +911,7 @@ Public Class Level ' Render entities: For i = 0 To Me.OffsetmapEntities.Count - 1 If i <= Me.OffsetmapEntities.Count - 1 Then - If Not Me.OffsetmapEntities(i) Is Nothing Then + If Me.OffsetmapEntities(i) IsNot Nothing Then Me.OffsetmapEntities(i).Render() DebugDisplay.MaxVertices += Me.OffsetmapEntities(i).VertexCount End If diff --git a/P3D/World/PokemonEncounter.vb b/P3D/World/PokemonEncounter.vb index 28f6b9664..e59a65de1 100644 --- a/P3D/World/PokemonEncounter.vb +++ b/P3D/World/PokemonEncounter.vb @@ -115,13 +115,13 @@ Public Class PokemonEncounter ' Generate new wild Pokémon: Dim Pokemon As Pokemon = Spawner.GetPokemon(Screen.Level.LevelFile, Me._levelReference.PokemonEncounterData.Method, True, Me._levelReference.PokemonEncounterData.PokeFile) - If Not Pokemon Is Nothing And CType(Core.CurrentScreen, OverworldScreen).TrainerEncountered = False And CType(Core.CurrentScreen, OverworldScreen).ActionScript.IsReady = True Then + If Pokemon IsNot Nothing And CType(Core.CurrentScreen, OverworldScreen).TrainerEncountered = False And CType(Core.CurrentScreen, OverworldScreen).ActionScript.IsReady = True Then Screen.Level.RouteSign.Hide() ' When a battle starts, hide the Route sign. ' If the player has a Repel going and the first Pokémon in the party's level is greater than the wild Pokémon's level, don't start the battle: If Core.Player.RepelSteps > 0 Then Dim p As Pokemon = Core.Player.GetWalkPokemon() - If Not p Is Nothing Then + If p IsNot Nothing Then If p.Level >= Pokemon.Level Then Exit Sub End If @@ -130,7 +130,7 @@ Public Class PokemonEncounter ' Cleanse Tag prevents wild Pokémon encounters if held by the first Pokémon in the party: If Core.Player.Pokemons(0).Level >= Pokemon.Level Then - If Not Core.Player.Pokemons(0).Item Is Nothing Then + If Core.Player.Pokemons(0).Item IsNot Nothing Then If Core.Player.Pokemons(0).Item.ID = 94 Then If Core.Random.Next(0, 3) = 0 Then Exit Sub @@ -141,7 +141,7 @@ Public Class PokemonEncounter ' Pure Incense lowers the chance of encountering wild Pokémon if held by the first Pokémon in the party: If Core.Player.Pokemons(0).Level >= Pokemon.Level Then - If Not Core.Player.Pokemons(0).Item Is Nothing Then + If Core.Player.Pokemons(0).Item IsNot Nothing Then If Core.Player.Pokemons(0).Item.ID = 291 Then If Core.Random.Next(0, 3) = 0 Then Exit Sub diff --git a/P3D/World/SkyDome.vb b/P3D/World/SkyDome.vb index 644e7b179..70142477e 100644 --- a/P3D/World/SkyDome.vb +++ b/P3D/World/SkyDome.vb @@ -72,7 +72,7 @@ Else RenderHalf(FOV, Yaw, 0.0F, True, TextureUp, 8.0F, 1.0F) - If Not TextureDown Is Nothing Then + If TextureDown IsNot Nothing Then RenderHalf(FOV, Yaw, 0.0F, False, TextureDown, 8.0F, 1.0F) End If End If