* Fixed a possible issue where updateLogicalState could cause an IndexOutOfBoundsException
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7167 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
548eb26428
commit
2611139702
@ -149,15 +149,13 @@ public class Node extends Spatial implements Savable {
|
||||
@Override
|
||||
public void updateLogicalState(float tpf){
|
||||
super.updateLogicalState(tpf);
|
||||
for (int i = 0, cSize = children.size(); i < cSize; i++) {
|
||||
|
||||
// FIXME: Iterating through the children list backwards
|
||||
// to avoid IndexOutOfBoundsException. This is sometimes unreliable,
|
||||
// a more robust solution is needed.
|
||||
for (int i = children.size(); i >= 0; i--){
|
||||
Spatial child = children.get(i);
|
||||
child.updateLogicalState(tpf);
|
||||
|
||||
// added this line so that nodes removed by Controls
|
||||
// don't cause IndexOutOfBoundsExceptions
|
||||
// FIXME: This is sometimes unreliable, a more
|
||||
// robust solution is needed
|
||||
cSize = children.size();
|
||||
}
|
||||
}
|
||||
|
||||
@ -477,6 +475,15 @@ public class Node extends Spatial implements Savable {
|
||||
return children;
|
||||
}
|
||||
|
||||
/**
|
||||
* Dead code
|
||||
*
|
||||
* @param geometry
|
||||
* @param index1
|
||||
* @param index2
|
||||
* @deprecated Dead code
|
||||
*/
|
||||
@Deprecated
|
||||
public void childChange(Geometry geometry, int index1, int index2) {
|
||||
//just pass to parent
|
||||
if(parent != null) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user