v0.4.3a: fixed several issues revealed by new bundle error reporting
This commit is contained in:
committed by
Evan Debenham
parent
ac3439d0e5
commit
22c1a0189c
@@ -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];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user