v3.1.0: fixed errors in note conversion for old runs
This commit is contained in:
@@ -377,6 +377,7 @@ public class Notes {
|
|||||||
DEPTH,
|
DEPTH,
|
||||||
ITEM_TYPE,
|
ITEM_TYPE,
|
||||||
SPECIFIC_ITEM,
|
SPECIFIC_ITEM,
|
||||||
|
ITEM //for pre-3.1 save conversion
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class CustomRecord extends Record {
|
public static class CustomRecord extends Record {
|
||||||
@@ -518,17 +519,12 @@ public class Notes {
|
|||||||
@Override
|
@Override
|
||||||
public void restoreFromBundle(Bundle bundle) {
|
public void restoreFromBundle(Bundle bundle) {
|
||||||
super.restoreFromBundle(bundle);
|
super.restoreFromBundle(bundle);
|
||||||
try {
|
type = bundle.getEnum(TYPE, CustomType.class);
|
||||||
type = bundle.getEnum(TYPE, CustomType.class);
|
|
||||||
} catch (Exception e){
|
|
||||||
//prior to v3.1 specific item notes and item type notes were the same
|
|
||||||
type = null;
|
|
||||||
}
|
|
||||||
ID = bundle.getInt(ID_NUMBER);
|
ID = bundle.getInt(ID_NUMBER);
|
||||||
|
|
||||||
if (bundle.contains(ITEM_CLASS)) {
|
if (bundle.contains(ITEM_CLASS)) {
|
||||||
itemClass = bundle.getClass(ITEM_CLASS);
|
itemClass = bundle.getClass(ITEM_CLASS);
|
||||||
if (type == null){
|
if (type == CustomType.ITEM){
|
||||||
//prior to v3.1 specific item notes and item type notes were the same
|
//prior to v3.1 specific item notes and item type notes were the same
|
||||||
//we assume notes are for a specific item if they're for an equipment
|
//we assume notes are for a specific item if they're for an equipment
|
||||||
if (EquipableItem.class.isAssignableFrom(itemClass)){
|
if (EquipableItem.class.isAssignableFrom(itemClass)){
|
||||||
|
|||||||
Reference in New Issue
Block a user