v0.9.1b: fixed actor IDs being duplicated in rare cases
This commit is contained in:
@@ -104,7 +104,12 @@ public abstract class Actor implements Bundlable {
|
|||||||
@Override
|
@Override
|
||||||
public void restoreFromBundle( Bundle bundle ) {
|
public void restoreFromBundle( Bundle bundle ) {
|
||||||
time = bundle.getFloat( TIME );
|
time = bundle.getFloat( TIME );
|
||||||
id = bundle.getInt( ID );
|
int incomingID = bundle.getInt( ID );
|
||||||
|
if (Actor.findById(id) == null){
|
||||||
|
id = incomingID;
|
||||||
|
} else {
|
||||||
|
id = nextID++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int nextID = 1;
|
private static int nextID = 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user