V0.1.1a: corrected Ankh not saving state (forgot to implement, doy..)

This commit is contained in:
Evan Debenham 2014-08-16 16:16:32 -04:00
parent af01b4e3e8
commit 3ce1347e52

View File

@ -25,6 +25,7 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite.Glowing; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite.Glowing;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.watabou.noosa.audio.Sample; import com.watabou.noosa.audio.Sample;
import com.watabou.utils.Bundle;
import java.util.ArrayList; import java.util.ArrayList;
@ -116,6 +117,22 @@ public class Ankh extends Item {
public Glowing glowing() { public Glowing glowing() {
return isBlessed() ? WHITE : null; return isBlessed() ? WHITE : null;
} }
private static final String BLESSED = "blessed";
@Override
public void storeInBundle( Bundle bundle ) {
super.storeInBundle( bundle );
bundle.put( BLESSED, blessed );
}
@Override
public void restoreFromBundle( Bundle bundle ) {
super.restoreFromBundle( bundle );
//TODO: remove when saves from 0.1.1 are invalidated
if (bundle.contains( BLESSED ))
blessed = bundle.getBoolean( BLESSED );
}
@Override @Override
public int price() { public int price() {