v0.9.2b: fixed actor ID issues caused by using "id" as a bundle key
This commit is contained in:
@@ -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++;
|
||||||
|
|||||||
+3
-3
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user