v0.9.1b: fixed actor IDs being duplicated in rare cases

This commit is contained in:
Evan Debenham 2021-01-02 19:38:02 -05:00
parent 52fe813db0
commit b41c403dea

View File

@ -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;