From 3562c044dafe8808fb658e444465dd87797416f9 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 18 Mar 2021 15:08:58 -0400 Subject: [PATCH] v0.9.2b: fixed actor ID issues caused by using "id" as a bundle key --- .../shatteredpixel/shatteredpixeldungeon/actors/Actor.java | 2 +- .../items/artifacts/TalismanOfForesight.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Actor.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Actor.java index 9b1799c81..901b6203d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Actor.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Actor.java @@ -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++; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TalismanOfForesight.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TalismanOfForesight.java index 9c8fe0370..ce32f5e35 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TalismanOfForesight.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TalismanOfForesight.java @@ -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); } }