From 8cfe5376252081a1354780ab2b23ca6fd360e1de Mon Sep 17 00:00:00 2001 From: Paul Speed Date: Tue, 26 Jan 2016 19:28:23 -0500 Subject: [PATCH] Fix clone to account for the update list added for update optimization. The updateList was cloned also and needs to be cleared out and the update flag reset as if freshly initialized. Thanks for lightbringer for pointing out the problem and solution. --- jme3-core/src/main/java/com/jme3/scene/Node.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jme3-core/src/main/java/com/jme3/scene/Node.java b/jme3-core/src/main/java/com/jme3/scene/Node.java index 74b14188d..f269446a5 100644 --- a/jme3-core/src/main/java/com/jme3/scene/Node.java +++ b/jme3-core/src/main/java/com/jme3/scene/Node.java @@ -687,6 +687,11 @@ public class Node extends Spatial { // childClone.parent = nodeClone; // nodeClone.children.add(childClone); // } + + // Reset the fields of the clone that should be in a 'new' state. + nodeClone.updateList = null; + nodeClone.updateListValid = false; // safe because parent is nulled out in super.clone() + return nodeClone; }