v0.4.3a: fixed several issues revealed by new bundle error reporting

This commit is contained in:
Evan Debenham
2016-10-22 11:20:14 -04:00
committed by Evan Debenham
parent ac3439d0e5
commit 22c1a0189c
2 changed files with 25 additions and 17 deletions

View File

@@ -88,21 +88,23 @@ public class Blob extends Actor {
super.restoreFromBundle( bundle );
if (bundle.contains(LENGTH)) {
cur = new int[bundle.getInt(LENGTH)];
} else {
//compatability with pre-0.4.2
cur = new int[1024];
}
off = new int[cur.length];
int[] data = bundle.getIntArray( CUR );
if (data != null) {
int start = bundle.getInt( START );
for (int i=0; i < data.length; i++) {
if (bundle.contains( CUR )) {
if (bundle.contains(LENGTH)) {
cur = new int[bundle.getInt(LENGTH)];
} else {
//compatability with pre-0.4.2
cur = new int[1024];
}
off = new int[cur.length];
int[] data = bundle.getIntArray(CUR);
int start = bundle.getInt(START);
for (int i = 0; i < data.length; i++) {
cur[i + start] = data[i];
volume += data[i];
}
}
}