v0.9.2b: fixed actor ID issues caused by using "id" as a bundle key

This commit is contained in:
Evan Debenham 2021-03-18 15:08:58 -04:00
parent 618f326577
commit 3562c044da
2 changed files with 4 additions and 4 deletions

View File

@ -105,7 +105,7 @@ public abstract class Actor implements Bundlable {
public void restoreFromBundle( Bundle bundle ) {
time = bundle.getFloat( TIME );
int incomingID = bundle.getInt( ID );
if (Actor.findById(id) == null){
if (Actor.findById(incomingID) == null){
id = incomingID;
} else {
id = nextID++;

View File

@ -351,7 +351,7 @@ public class TalismanOfForesight extends Artifact {
public int charID;
public int depth = Dungeon.depth;
private static final String ID = "id";
private static final String CHAR_ID = "char_id";
@Override
public void detach() {
@ -363,13 +363,13 @@ public class TalismanOfForesight extends Artifact {
@Override
public void restoreFromBundle(Bundle bundle) {
super.restoreFromBundle(bundle);
charID = bundle.getInt(ID);
charID = bundle.getInt(CHAR_ID);
}
@Override
public void storeInBundle(Bundle bundle) {
super.storeInBundle(bundle);
bundle.put(ID, charID);
bundle.put(CHAR_ID, charID);
}
}