v2.0.0: unequipping secon wep with a full inventory no longer drops it
This commit is contained in:
@@ -181,17 +181,23 @@ abstract public class KindOfWeapon extends EquipableItem {
|
|||||||
public boolean doUnequip( Hero hero, boolean collect, boolean single ) {
|
public boolean doUnequip( Hero hero, boolean collect, boolean single ) {
|
||||||
boolean second = hero.belongings.secondWep == this;
|
boolean second = hero.belongings.secondWep == this;
|
||||||
|
|
||||||
|
if (second){
|
||||||
|
//do this first so that the item can go to a full inventory
|
||||||
|
hero.belongings.secondWep = null;
|
||||||
|
}
|
||||||
|
|
||||||
if (super.doUnequip( hero, collect, single )) {
|
if (super.doUnequip( hero, collect, single )) {
|
||||||
|
|
||||||
if (second){
|
if (!second){
|
||||||
hero.belongings.secondWep = null;
|
|
||||||
} else {
|
|
||||||
hero.belongings.weapon = null;
|
hero.belongings.weapon = null;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
if (second){
|
||||||
|
hero.belongings.secondWep = this;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user