v2.2.0: fixed tengu rarely throwing two bombs at the same tile
This commit is contained in:
@@ -556,10 +556,16 @@ public class Tengu extends Mob {
|
||||
|
||||
int targetCell = -1;
|
||||
|
||||
//Targets closest cell which is adjacent to target
|
||||
//Targets closest cell which is adjacent to target and has no existing bombs
|
||||
for (int i : PathFinder.NEIGHBOURS8){
|
||||
int cell = target.pos + i;
|
||||
if (!Dungeon.level.solid[cell] &&
|
||||
boolean bombHere = false;
|
||||
for (BombAbility b : thrower.buffs(BombAbility.class)){
|
||||
if (b.bombPos == cell){
|
||||
bombHere = true;
|
||||
}
|
||||
}
|
||||
if (!bombHere && !Dungeon.level.solid[cell] &&
|
||||
(targetCell == -1 || Dungeon.level.trueDistance(cell, thrower.pos) < Dungeon.level.trueDistance(targetCell, thrower.pos))){
|
||||
targetCell = cell;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user