From 6c3f8966045c7b09e8dfc85a9879e8b26a76db8d Mon Sep 17 00:00:00 2001 From: "nor..67" Date: Tue, 15 Nov 2011 20:54:51 +0000 Subject: [PATCH] - another fix in deserialization of TerrainGrid git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8685 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../com/jme3/terrain/geomipmap/TerrainGrid.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainGrid.java b/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainGrid.java index 1bf6e8cb2..79505e8ed 100644 --- a/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainGrid.java +++ b/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainGrid.java @@ -237,8 +237,8 @@ public class TerrainGrid extends TerrainQuad { public TerrainGrid() { } - - private void initData(){ + + private void initData() { int maxVisibleSize = size; this.quarterSize = maxVisibleSize >> 2; this.quadSize = (maxVisibleSize + 1) >> 1; @@ -452,9 +452,11 @@ public class TerrainGrid extends TerrainQuad { offsetAmount = c.readFloat("offsetAmount", 0); terrainQuadGrid = (TerrainQuadGrid) c.readSavable("terrainQuadGrid", null); initData(); - terrainQuadGrid.setSize(this.size); - terrainQuadGrid.setPatchSize(this.patchSize); - terrainQuadGrid.setQuadSize(this.quadSize); + if (terrainQuadGrid != null) { + terrainQuadGrid.setSize(this.size); + terrainQuadGrid.setPatchSize(this.patchSize); + terrainQuadGrid.setQuadSize(this.quadSize); + } } @Override