v0.6.2: fixed magical sleep not detaching when ai state is assigned

This commit is contained in:
Evan Debenham 2017-09-19 02:24:28 -04:00
parent 6d8e64d5bd
commit 495a3cdb4b

View File

@ -57,6 +57,10 @@ public class MagicalSleep extends Buff {
@Override
public boolean act(){
if (target instanceof Mob && ((Mob) target).state != ((Mob) target).SLEEPING){
detach();
return true;
}
if (target instanceof Hero) {
target.HP = Math.min(target.HP+1, target.HT);
((Hero) target).resting = true;