v0.2.4d: fixed a bug where losing a bag wouldn't remove items from the quickslot.

This commit is contained in:
Evan Debenham 2015-03-20 11:33:03 -04:00
parent d3899871ac
commit 1ee7bbba41

View File

@ -21,6 +21,7 @@ import java.util.ArrayList;
import java.util.Iterator;
import com.shatteredpixel.shatteredpixeldungeon.Badges;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
@ -45,12 +46,6 @@ public class Bag extends Item implements Iterable<Item> {
public int size = 1;
@Override
public ArrayList<String> actions( Hero hero ) {
ArrayList<String> actions = super.actions( hero );
return actions;
}
@Override
public void execute( Hero hero, String action ) {
if (action.equals( AC_OPEN )) {
@ -85,11 +80,13 @@ public class Bag extends Item implements Iterable<Item> {
}
}
@Override
public void onDetach( ) {
this.owner = null;
}
@Override
public void onDetach( ) {
this.owner = null;
for (Item item : items)
Dungeon.quickslot.clearItem(item);
}
@Override
public boolean isUpgradable() {
return false;
@ -111,7 +108,7 @@ public class Bag extends Item implements Iterable<Item> {
super.storeInBundle( bundle );
bundle.put( ITEMS, items );
}
@Override
public void restoreFromBundle( Bundle bundle ) {
super.restoreFromBundle( bundle );