v2.0.0: fixed rare cases of WoL incorrectly taking hero kill credit

This commit is contained in:
Evan Debenham
2023-02-06 14:06:56 -05:00
parent 3e4209d621
commit e677ada33b

View File

@@ -82,18 +82,17 @@ public class WandOfLightning extends DamageWand {
continue;
}
wandProc(ch, chargesPerCast());
if (ch == curUser) {
if (ch == curUser && ch.isAlive()) {
ch.damage(Math.round(damageRoll() * multipler * 0.5f), this);
if (!curUser.isAlive()) {
Badges.validateDeathFromFriendlyMagic();
Dungeon.fail( getClass() );
GLog.n(Messages.get(this, "ondeath"));
}
} else {
ch.damage(Math.round(damageRoll() * multipler), this);
}
}
if (!curUser.isAlive()) {
Badges.validateDeathFromFriendlyMagic();
Dungeon.fail( getClass() );
GLog.n(Messages.get(this, "ondeath"));
}
}
@Override