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
@@ -105,7 +105,7 @@ public abstract class Actor implements Bundlable {
public void restoreFromBundle( Bundle bundle ) { public void restoreFromBundle( Bundle bundle ) {
time = bundle.getFloat( TIME ); time = bundle.getFloat( TIME );
int incomingID = bundle.getInt( ID ); int incomingID = bundle.getInt( ID );
if (Actor.findById(id) == null){ if (Actor.findById(incomingID) == null){
id = incomingID; id = incomingID;
} else { } else {
id = nextID++; id = nextID++;
@@ -351,7 +351,7 @@ public class TalismanOfForesight extends Artifact {
public int charID; public int charID;
public int depth = Dungeon.depth; public int depth = Dungeon.depth;
private static final String ID = "id"; private static final String CHAR_ID = "char_id";
@Override @Override
public void detach() { public void detach() {
@@ -363,13 +363,13 @@ public class TalismanOfForesight extends Artifact {
@Override @Override
public void restoreFromBundle(Bundle bundle) { public void restoreFromBundle(Bundle bundle) {
super.restoreFromBundle(bundle); super.restoreFromBundle(bundle);
charID = bundle.getInt(ID); charID = bundle.getInt(CHAR_ID);
} }
@Override @Override
public void storeInBundle(Bundle bundle) { public void storeInBundle(Bundle bundle) {
super.storeInBundle(bundle); super.storeInBundle(bundle);
bundle.put(ID, charID); bundle.put(CHAR_ID, charID);
} }
} }