v0.2.3e: tonnes of fixes relating to WIP multi-quickslot implementation

This commit is contained in:
Evan Debenham
2015-01-20 00:56:36 -05:00
parent e53c6b678f
commit 6e3c2223cd
13 changed files with 66 additions and 36 deletions
@@ -19,6 +19,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items;
import java.util.ArrayList;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.ui.QuickSlot;
@@ -48,8 +49,12 @@ public class KindOfWeapon extends EquipableItem {
@Override
public boolean doEquip( Hero hero ) {
int slot = Dungeon.quickslot.getSlot( this );
detachAll( hero.belongings.backpack );
if (slot != -1) Dungeon.quickslot.setSlot( slot, this );
if (hero.belongings.weapon == null || hero.belongings.weapon.doUnequip( hero, true )) {