v0.3.5: fixed spears being able to attack through walls

This commit is contained in:
Evan Debenham
2016-04-22 02:30:52 -04:00
parent b731569f85
commit 6e1bab6e89
3 changed files with 26 additions and 14 deletions
@@ -171,10 +171,7 @@ public class Combo extends Buff implements ActionIndicator.Action {
public void onSelect(Integer cell) {
if (cell == null) return;
final Char enemy = Actor.findChar( cell );
int userPos = target.pos;
if (enemy == null || userPos == cell || (Dungeon.hero.belongings.weapon != null ?
Level.distance( userPos, enemy.pos ) > Dungeon.hero.belongings.weapon.reachFactor(Dungeon.hero)
: !Level.adjacent( userPos, enemy.pos ))){
if (enemy == null || !((Hero)target).canAttack(enemy) || target.isCharmedBy( enemy )){
GLog.w( Messages.get(Combo.class, "bad_target") );
} else {
target.sprite.attack(cell, new Callback() {