v0.9.2b: fixed combo leap placing glad onto visible traps or chasms

This commit is contained in:
Evan Debenham
2021-03-18 16:55:05 -04:00
parent 3b1d93abef
commit 8c51d26a0a
@@ -455,11 +455,15 @@ public class Combo extends Buff implements ActionIndicator.Action {
} else { } else {
Ballistica c = new Ballistica(target.pos, enemy.pos, Ballistica.PROJECTILE); Ballistica c = new Ballistica(target.pos, enemy.pos, Ballistica.PROJECTILE);
if (c.collisionPos == enemy.pos){ if (c.collisionPos == enemy.pos){
final int leapPos = c.path.get(c.dist-1);
if (!Dungeon.level.passable[leapPos]){
GLog.w(Messages.get(Combo.class, "bad_target"));
} else {
Dungeon.hero.busy(); Dungeon.hero.busy();
target.sprite.jump(target.pos, c.path.get(c.dist-1), new Callback() { target.sprite.jump(target.pos, leapPos, new Callback() {
@Override @Override
public void call() { public void call() {
target.move(c.path.get(c.dist-1)); target.move(leapPos);
Dungeon.level.occupyCell(target); Dungeon.level.occupyCell(target);
Dungeon.observe(); Dungeon.observe();
GameScene.updateFog(); GameScene.updateFog();
@@ -471,6 +475,7 @@ public class Combo extends Buff implements ActionIndicator.Action {
}); });
} }
}); });
}
} else { } else {
GLog.w(Messages.get(Combo.class, "bad_target")); GLog.w(Messages.get(Combo.class, "bad_target"));
} }