v0.9.1b: fixed actor IDs being duplicated in rare cases
This commit is contained in:
parent
52fe813db0
commit
b41c403dea
|
@ -104,7 +104,12 @@ public abstract class Actor implements Bundlable {
|
|||
@Override
|
||||
public void restoreFromBundle( Bundle bundle ) {
|
||||
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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user