v1.0.3: fixed some aspects of lost inventory being lost on save/load

This commit is contained in:
Evan Debenham 2021-08-30 19:19:13 -04:00
parent 72e0b6ee1c
commit 724ffbb85b

View File

@ -152,13 +152,13 @@ public class Belongings implements Iterable<Item> {
backpack.restoreFromBundle( bundle ); backpack.restoreFromBundle( bundle );
weapon = (KindOfWeapon) bundle.get(WEAPON); weapon = (KindOfWeapon) bundle.get(WEAPON);
if (weapon != null) { if (weapon() != null) {
weapon.activate(owner); weapon().activate(owner);
} }
armor = (Armor)bundle.get( ARMOR ); armor = (Armor)bundle.get( ARMOR );
if (armor != null){ if (armor() != null){
armor.activate( owner ); armor().activate( owner );
} }
//pre-0.8.2 //pre-0.8.2
@ -189,9 +189,9 @@ public class Belongings implements Iterable<Item> {
ring = (Ring) bundle.get(RING); ring = (Ring) bundle.get(RING);
} }
if (artifact != null) artifact.activate(owner); if (artifact() != null) artifact().activate(owner);
if (misc != null) misc.activate( owner ); if (misc() != null) misc().activate( owner );
if (ring != null) ring.activate( owner ); if (ring() != null) ring().activate( owner );
} }
public static void preview( GamesInProgress.Info info, Bundle bundle ) { public static void preview( GamesInProgress.Info info, Bundle bundle ) {