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