v3.0.0: fixed beaming ray and stasis sometimes playing allies over chasm

This commit is contained in:
Evan Debenham
2025-02-21 12:40:10 -05:00
parent 987f04f308
commit 06da6f9ef1
2 changed files with 4 additions and 2 deletions

View File

@@ -89,7 +89,8 @@ public class BeamingRay extends TargetedClericSpell {
if (Dungeon.level.solid[telePos] || !Dungeon.level.heroFOV[telePos] || Actor.findChar(telePos) != null){
telePos = -1;
for (int i : PathFinder.NEIGHBOURS8){
if (Actor.findChar(target+i) == null && !Dungeon.level.solid[target+i] && Dungeon.level.heroFOV[target+i]){
if (Actor.findChar(target+i) == null && Dungeon.level.heroFOV[target+i]
&& (Dungeon.level.passable[target+i] || (ally.flying && Dungeon.level.avoid[target+i])) ){
if (telePos == -1 || Dungeon.level.trueDistance(telePos, ally.pos) > Dungeon.level.trueDistance(target+i, ally.pos)){
telePos = target+i;
}

View File

@@ -152,7 +152,8 @@ public class Stasis extends ClericSpell {
ArrayList<Integer> spawnPoints = new ArrayList<>();
for (int i = 0; i < PathFinder.NEIGHBOURS8.length; i++) {
int p = target.pos + PathFinder.NEIGHBOURS8[i];
if (Actor.findChar(p) == null && (Dungeon.level.passable[p] || Dungeon.level.avoid[p])) {
if (Actor.findChar(p) == null
&& (Dungeon.level.passable[p] || (stasisAlly.flying && Dungeon.level.avoid[p])) ){
spawnPoints.add(p);
}
}