v0.2.2: fixed a bug with multiple ankhs in both blessed and unblessed states
This commit is contained in:
parent
063dc55933
commit
a17c141738
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user