From c328f5ab9aa650f476195464b0606a3328c1e67b Mon Sep 17 00:00:00 2001 From: "nor..67" Date: Wed, 3 Oct 2012 03:26:22 +0000 Subject: [PATCH] - more effective null check for TerrainLodControl git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9822 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../com/jme3/terrain/geomipmap/TerrainLodControl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainLodControl.java b/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainLodControl.java index a18830a22..b9779fe54 100644 --- a/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainLodControl.java +++ b/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainLodControl.java @@ -158,6 +158,10 @@ public class TerrainLodControl extends AbstractControl { // do all of the LOD calculations protected void updateLOD(List locations, LodCalculator lodCalculator) { + if(getSpatial() == null){ + return; + } + // update any existing ones that need updating updateQuadLODs(); @@ -201,9 +205,6 @@ public class TerrainLodControl extends AbstractControl { protected void prepareTerrain() { TerrainQuad terrain = (TerrainQuad)getSpatial(); - if(terrain == null){ - return; - } terrain.cacheTerrainTransforms();// cache the terrain's world transforms so they can be accessed on the separate thread safely }