v0.2.4: refactored handling the quickslot when equipping.
This commit is contained in:
@@ -38,7 +38,14 @@ public abstract class EquipableItem extends Item {
|
||||
@Override
|
||||
public void execute( Hero hero, String action ) {
|
||||
if (action.equals( AC_EQUIP )) {
|
||||
doEquip( hero );
|
||||
//In addition to equipping itself, item reassigns itself to the quickslot
|
||||
//This is a special case as the item is being removed from inventory, but is staying with the hero.
|
||||
int slot = Dungeon.quickslot.getSlot( this );
|
||||
doEquip(hero);
|
||||
if (slot != -1) {
|
||||
Dungeon.quickslot.setSlot( slot, this );
|
||||
updateQuickslot();
|
||||
}
|
||||
} else if (action.equals( AC_UNEQUIP )) {
|
||||
doUnequip( hero, true );
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user