* Fixed error in TerrainPatch loading
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9067 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
96bde02de6
commit
e7eba5b155
@ -124,15 +124,21 @@ public class SavableClassUtil {
|
||||
public static int getSavedSavableVersion(Object savable, Class<? extends Savable> desiredClass, int[] versions){
|
||||
Class thisClass = savable.getClass();
|
||||
int count = 0;
|
||||
while (thisClass != null && thisClass != desiredClass){
|
||||
|
||||
while (true) {
|
||||
thisClass = thisClass.getSuperclass();
|
||||
count ++;
|
||||
if (thisClass != null && SavableClassUtil.isImplementingSavable(thisClass)){
|
||||
count ++;
|
||||
}else{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (thisClass == null){
|
||||
throw new IllegalArgumentException(savable.getClass().getName() +
|
||||
" does not extend " +
|
||||
desiredClass.getName() + "!");
|
||||
}else if (count > versions.length){
|
||||
}else if (count >= versions.length){
|
||||
throw new IllegalArgumentException(savable.getClass().getName() +
|
||||
" cannot access version of " +
|
||||
desiredClass.getName() +
|
||||
|
Loading…
x
Reference in New Issue
Block a user