v2.0.0: fixed very rare cases of tengu throwing bombs into walls
This commit is contained in:
@@ -558,8 +558,8 @@ public class Tengu extends Mob {
|
|||||||
//Targets closest cell which is adjacent to target
|
//Targets closest cell which is adjacent to target
|
||||||
for (int i : PathFinder.NEIGHBOURS8){
|
for (int i : PathFinder.NEIGHBOURS8){
|
||||||
int cell = target.pos + i;
|
int cell = target.pos + i;
|
||||||
if (targetCell == -1 ||
|
if (!Dungeon.level.solid[cell] &&
|
||||||
Dungeon.level.trueDistance(cell, thrower.pos) < Dungeon.level.trueDistance(targetCell, thrower.pos)){
|
(targetCell == -1 || Dungeon.level.trueDistance(cell, thrower.pos) < Dungeon.level.trueDistance(targetCell, thrower.pos))){
|
||||||
targetCell = cell;
|
targetCell = cell;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user