From 9b29e05968d97fc4ddedb401063ecee33929db17 Mon Sep 17 00:00:00 2001 From: MeFisto94 Date: Sat, 18 Jan 2020 10:53:58 +0100 Subject: [PATCH] Fixes #1261 - Clone the Terrain Picker, so that loading a terrain from file still works (after cloning, the picker would have the wrong terrain quad instance) --- .../main/java/com/jme3/terrain/geomipmap/TerrainQuad.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/TerrainQuad.java b/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/TerrainQuad.java index f89198f25..e60ffb7bf 100644 --- a/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/TerrainQuad.java +++ b/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/TerrainQuad.java @@ -1793,9 +1793,8 @@ public class TerrainQuad extends Node implements Terrain { // This was not cloned before... I think that's a mistake. this.affectedAreaBBox = cloner.clone(affectedAreaBBox); - // picker is not cloneable and not cloned. This also seems like - // a mistake if you ever load the same terrain twice. - // this.picker = cloner.clone(picker); + // Otherwise, picker would be cloned by reference and thus "this" would be wrong + this.picker = new BresenhamTerrainPicker(this); // neighbourFinder is also not cloned. Maybe that's ok. }