v0.2.2: fixed a bug with multiple ankhs in both blessed and unblessed states

This commit is contained in:
Evan Debenham 2014-10-29 16:00:21 -04:00
parent 063dc55933
commit a17c141738

View File

@ -1181,8 +1181,17 @@ public class Hero extends Char {
curAction = null;
//todo: investigate this, what would happen if the player has a blessed & unblessed ankh?
Ankh ankh = (Ankh)belongings.getItem( Ankh.class );
Ankh ankh = null;
//look for ankhs in player inventory, prioritize ones which are blessed.
for (Item item : belongings){
if (item instanceof Ankh) {
if (ankh == null || ((Ankh) item).isBlessed()) {
ankh = (Ankh) item;
}
}
}
if (ankh != null && ankh.isBlessed()) {
this.HP = HT;