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;
|
curAction = null;
|
||||||
|
|
||||||
//todo: investigate this, what would happen if the player has a blessed & unblessed ankh?
|
Ankh ankh = null;
|
||||||
Ankh ankh = (Ankh)belongings.getItem( Ankh.class );
|
|
||||||
|
//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()) {
|
if (ankh != null && ankh.isBlessed()) {
|
||||||
this.HP = HT;
|
this.HP = HT;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user