v2.0.0: fixed projecting not working with runic slash

This commit is contained in:
Evan Debenham
2023-02-21 16:55:21 -05:00
parent 97a71c60b5
commit ee3cd3f120

View File

@@ -235,7 +235,8 @@ abstract public class KindOfWeapon extends EquipableItem {
}
public boolean canReach( Char owner, int target){
if (Dungeon.level.distance( owner.pos, target ) > reachFactor(owner)){
int reach = reachFactor(owner);
if (Dungeon.level.distance( owner.pos, target ) > reach){
return false;
} else {
boolean[] passable = BArray.not(Dungeon.level.solid, null);
@@ -243,9 +244,9 @@ abstract public class KindOfWeapon extends EquipableItem {
if (ch != owner) passable[ch.pos] = false;
}
PathFinder.buildDistanceMap(target, passable, reachFactor(owner));
PathFinder.buildDistanceMap(target, passable, reach);
return PathFinder.distance[owner.pos] <= reachFactor(owner);
return PathFinder.distance[owner.pos] <= reach;
}
}