From eb69a8ee5b2b1f35f8a438c61c45fd508b86fd39 Mon Sep 17 00:00:00 2001 From: JappaWakka Date: Sun, 24 Jul 2022 10:45:18 +0200 Subject: [PATCH] Maybe this'll prevent animatedblock crash --- P3D/Entites/Enviroment/AnimatedBlock.vb | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/P3D/Entites/Enviroment/AnimatedBlock.vb b/P3D/Entites/Enviroment/AnimatedBlock.vb index 5edec2954..d4ab4b2a3 100644 --- a/P3D/Entites/Enviroment/AnimatedBlock.vb +++ b/P3D/Entites/Enviroment/AnimatedBlock.vb @@ -184,19 +184,17 @@ End Sub Private Sub ChangeTexture(ByVal n As Integer) - 'If Core.GameOptions.GraphicStyle = 1 Then - If BlockTexturesTemp.Count = 0 Then ClearAnimationResources() CreateBlockTextureTemp() End If - Dim i = Animations(n).CurrentRow - Dim j = Animations(n).CurrentColumn - If BlockTexturesTemp.ContainsKey(AnimationNames(n) & "_" & (j + columns(n) * i)) = True Then - Me.Textures(n) = BlockTexturesTemp(AnimationNames(n) & "_" & (j + columns(n) * i)) + If Not Animations Is Nothing Then + Dim i = Animations(n).CurrentRow + Dim j = Animations(n).CurrentColumn + If BlockTexturesTemp.ContainsKey(AnimationNames(n) & "_" & (j + columns(n) * i)) = True Then + Me.Textures(n) = BlockTexturesTemp(AnimationNames(n) & "_" & (j + columns(n) * i)) + End If End If - - 'End If End Sub Public Overrides Sub ResultFunction(ByVal Result As Integer)