Some more IsNot

This commit is contained in:
Daniel S. Billing 2021-02-16 21:49:43 +01:00
parent c42136295f
commit c99bdab082
7 changed files with 18 additions and 18 deletions

View File

@ -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()

View File

@ -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))

View File

@ -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

View File

@ -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)

View File

@ -671,7 +671,7 @@ Public Class Level
''' Initializes the offset map update cycle.
''' </summary>
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

View File

@ -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

View File

@ -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