v3.0.1: fixed quick-using item from bag using the bag's targeting props
This commit is contained in:
@@ -55,8 +55,23 @@ public class Bag extends Item implements Iterable<Item> {
|
||||
return 20; // default container size
|
||||
}
|
||||
|
||||
//if an item is being quick-used from the bag, the bag should take on its targeting properties
|
||||
public Item quickUseItem;
|
||||
|
||||
@Override
|
||||
public int targetingPos(Hero user, int dst) {
|
||||
if (quickUseItem != null){
|
||||
int target = quickUseItem.targetingPos(user, dst);
|
||||
quickUseItem = null;
|
||||
return target;
|
||||
} else {
|
||||
return super.targetingPos(user, dst);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute( Hero hero, String action ) {
|
||||
quickUseItem = null;
|
||||
|
||||
super.execute( hero, action );
|
||||
|
||||
|
||||
@@ -109,6 +109,7 @@ public class WndQuickBag extends Window {
|
||||
int idx = Dungeon.quickslot.getSlot(WndQuickBag.bag);
|
||||
if (idx != -1){
|
||||
QuickSlotButton.useTargeting(idx);
|
||||
bag.quickUseItem = item;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user