Skip to content

Commit 9b29e05

Browse files
committed
Fixes jMonkeyEngine#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)
1 parent 933b091 commit 9b29e05

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/TerrainQuad.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1793,9 +1793,8 @@ public void cloneFields( Cloner cloner, Object original ) {
17931793
// This was not cloned before... I think that's a mistake.
17941794
this.affectedAreaBBox = cloner.clone(affectedAreaBBox);
17951795

1796-
// picker is not cloneable and not cloned. This also seems like
1797-
// a mistake if you ever load the same terrain twice.
1798-
// this.picker = cloner.clone(picker);
1796+
// Otherwise, picker would be cloned by reference and thus "this" would be wrong
1797+
this.picker = new BresenhamTerrainPicker(this);
17991798

18001799
// neighbourFinder is also not cloned. Maybe that's ok.
18011800
}

0 commit comments

Comments
 (0)