Merge pull request from MeFisto94/fix-terrain-picker

Fixes  - Clone the Terrain Picker, so that loading a terrain from file still works (after cloning, the picker would have the wrong terrain quad instance)
This commit is contained in:
Paul Speed 2020-01-18 11:53:26 -05:00 committed by GitHub
commit 81f9b9d92a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1793,9 +1793,8 @@ public class TerrainQuad extends Node implements Terrain {
// This was not cloned before... I think that's a mistake. // This was not cloned before... I think that's a mistake.
this.affectedAreaBBox = cloner.clone(affectedAreaBBox); this.affectedAreaBBox = cloner.clone(affectedAreaBBox);
// picker is not cloneable and not cloned. This also seems like // Otherwise, picker would be cloned by reference and thus "this" would be wrong
// a mistake if you ever load the same terrain twice. this.picker = new BresenhamTerrainPicker(this);
// this.picker = cloner.clone(picker);
// neighbourFinder is also not cloned. Maybe that's ok. // neighbourFinder is also not cloned. Maybe that's ok.
} }