UserData : setUserData(someKey,null) now properly removes the user data from the map.

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9670 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
rem..om 12 years ago
parent a04d5dde01
commit 206a6b74f3
  1. 4
      engine/src/core/com/jme3/scene/Spatial.java

@ -1215,7 +1215,9 @@ public abstract class Spatial implements Savable, Cloneable, Collidable, Cloneab
userData = new HashMap<String, Savable>();
}
if (data instanceof Savable) {
if(data == null){
userData.remove(key);
}else if (data instanceof Savable) {
userData.put(key, (Savable) data);
} else {
userData.put(key, new UserData(UserData.getObjectType(data), data));

Loading…
Cancel
Save