v2.0.0: fixed very rare cases of tengu throwing bombs into walls

This commit is contained in:
Evan Debenham
2023-01-30 11:49:56 -05:00
parent d372178632
commit b6b2dadc0a

View File

@@ -558,8 +558,8 @@ public class Tengu extends Mob {
//Targets closest cell which is adjacent to target
for (int i : PathFinder.NEIGHBOURS8){
int cell = target.pos + i;
if (targetCell == -1 ||
Dungeon.level.trueDistance(cell, thrower.pos) < Dungeon.level.trueDistance(targetCell, thrower.pos)){
if (!Dungeon.level.solid[cell] &&
(targetCell == -1 || Dungeon.level.trueDistance(cell, thrower.pos) < Dungeon.level.trueDistance(targetCell, thrower.pos))){
targetCell = cell;
}
}